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

Support reconnecting to the server #1140

Closed
niloc132 opened this issue Mar 7, 2023 · 0 comments · Fixed by #1149
Closed

Support reconnecting to the server #1140

niloc132 opened this issue Mar 7, 2023 · 0 comments · Fixed by #1149
Labels
enhancement New feature or request
Milestone

Comments

@niloc132
Copy link
Member

niloc132 commented Mar 7, 2023

As a user, if I momentarily lose connection to a running server (wifi/vpn drops, laptop lid closes), I would like to continue using the console/app without refreshing the page.

With deephaven/deephaven-core#3502 merged, the dh.IdeConnection.HACK_CONNECTION_FAILURE is deprecated, and no longer needed, but still left in place until the web UI is updated to support disconnect/reconnect events.

Tables and figures are functional already, but the console component for the dh.IdeConnection does not hint to the user that the connection is lost and commands cannot be run, until the reconnect event occurs.

Note that in some cases the session might have expired or the server restarted and all sessions invalidated. In this case, the disconnect event will still occur, but the JS API cannot yet create a new session (see deephaven/deephaven-core#3501), so instead the dh.CoreClient.EVENT_RECONNECT_AUTH_FAILED event will be fired from the dh.CoreClient instance.

@niloc132 niloc132 added enhancement New feature or request triage Issue requires triage labels Mar 7, 2023
@vbabich vbabich added this to the March 2023 milestone Mar 8, 2023
@vbabich vbabich removed the triage Issue requires triage label Mar 8, 2023
mofojed added a commit that referenced this issue Mar 29, 2023
- Listen for `EVENT_DISCONNECT` and `EVENT_RECONNECT` on the connection,
and display a "Reconnecting..." message in the console.
- No longer listen to the `HACK_CONNECTION_FAILURE` (it's been
deprecated).
- Listen for the `SHUTDOWN` event and display a message after shutdown.
- Fixes #1140 
Testing steps:
1. Start up server with deephaven-core JS API reconnect changes:
deephaven/deephaven-core#3502
2. Use ngrok to start a tunnel to that port, e.g.: `ngrok http 10000`
3. Start up Web UI connecting to that tunnel, e.g.:
`VITE_CORE_API_URL=http://acfc-23-233-0-34.ngrok.io/jsapi npm start`
4. Open the Web UI in Firefox, run some commands to make sure initial
connection is fine.
5. Press Alt and from the File menu, select "Work Offline"
6. See it transition to a disconnected state. Disconnected message
should appear and should not be able to enter new commands
7. Reconnect by deselecting "Work Offline" option from Step 5
8. See it transition to connected state. Should be able to run commands
and have the results appear.
9. Kill the server (Ctrl+C). See it transition to a Shutdown state, app
unloaded.
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
enhancement New feature or request
Projects
None yet
Development

Successfully merging a pull request may close this issue.

2 participants