Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

JS API should attempt to reconnect to the gRPC server #3502

Merged
merged 18 commits into from
Mar 24, 2023
Merged
Changes from 1 commit
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
Prev Previous commit
Next Next commit
Merge branch 'main' into 730-js-api-reconnect
niloc132 committed Mar 2, 2023

Verified

This commit was signed with the committer’s verified signature. The key has expired.
RomainMuller Romain Marcadier
commit 2103915a08f85ed36007bb964c49c728ecd93add
Original file line number Diff line number Diff line change
@@ -69,6 +69,8 @@ public QueryConnectable() {

public abstract Promise<ConnectToken> getConnectToken();

public abstract Promise<ConnectOptions> getConnectOptions();

@Deprecated
public void notifyConnectionError(ResponseStreamWrapper.Status status) {
if (notifiedConnectionError) {
Original file line number Diff line number Diff line change
@@ -88,7 +88,6 @@
import io.deephaven.web.client.state.ClientTableState;
import io.deephaven.web.client.state.HasTableBinding;
import io.deephaven.web.client.state.TableReviver;
import io.deephaven.web.shared.data.ConnectToken;
import io.deephaven.web.shared.data.DeltaUpdates;
import io.deephaven.web.shared.data.LogItem;
import io.deephaven.web.shared.data.RangeSet;
@@ -260,23 +259,23 @@ public WorkerConnection(QueryConnectable<?> info) {
private void connectToWorker() {
info.onReady()
.then(queryWorkerRunning -> {
// if there is already a token, use that
// if (metadata.has(FLIGHT_AUTH_HEADER_NAME)) {
// JsArray<String> value = metadata.get(FLIGHT_AUTH_HEADER_NAME);
// ConnectToken token = new ConnectToken();
// token.setType(value.getAt(0));
// token.setValue("");
// return Promise.resolve(token);
// }
// get the auth token
return info.getConnectToken();
}).then(authToken -> {
JsLog.warn("setting auth ", authToken.getType());
// set the proposed initial token and make the first call
metadata.set(FLIGHT_AUTH_HEADER_NAME, (authToken.getType() + " " + authToken.getValue()).trim());
return authUpdate().then(ignore -> Promise.resolve(Boolean.TRUE));
return Promise.all(
info.getConnectToken().then(authToken -> {
JsLog.warn("setting auth ", authToken.getType());
// set the proposed initial token and make the first call
metadata.set(FLIGHT_AUTH_HEADER_NAME,
(authToken.getType() + " " + authToken.getValue()).trim());
return Promise.resolve(authToken);
}),
info.getConnectOptions().then(options -> {
// set other specified headers, if any
JsObject.keys(options.headers).forEach((key, index, arr) -> {
metadata.set(key, options.headers.get(key));
return null;
});
return Promise.resolve(options);
})).then(ignore -> authUpdate()).then(ignore -> Promise.resolve(Boolean.TRUE));
}).then(newSession -> {
JsLog.warn("have session");
// subscribe to fatal errors
subscribeToTerminationNotification();

You are viewing a condensed version of this merge commit. You can view the full changes here.