learningequality / learningequality/studio
Implement defensive handling of websocket connection
Open
@ozer550 is already working on this.
Since Oct 6, 2022.
DEV: frontend
TAG: new feature
TAG: tech update / debt
- Dominant language
- Python
- Stars
- 191
- Forks
- 307
- Avg merge
- 5d 6h
- Merged PRs (30d)
- 10
Description
Background / Epic: https://github.com/learningequality/studio/issues/3630
Prerequisite: https://github.com/learningequality/studio/issues/3656
Observed behavior
- Currently, if the websocket gets closed, the frontend does not robustly handle it and requires the user to refresh the page
Expected behavior
- The frontend should robustly handle internet connectivity issues, automatically managing the reopening of the connection if it becomes closed or interrupted
- If frontend fails to send a message(s) because the connection has been closed, it should resend them over the sync API
- This will fast-forward the client's browser to guard against messages that weren't received during that time
- Perhaps generally speaking we should always call the sync API right before establishing the websocket connection to achieve the fast-forward behavior
User-facing consequences
- We don't want to require the user to refresh the page for a functional editing experience
Additional information
- We want to https://github.com/learningequality/studio/issues/3656 first to clear up any other issues that might cause unintended connection closure in our infrastructure
Steps to reproduce the issue
- Open a channel on the websocket server https://websockets.studio.learningequality.org/ (note: seems like it's no longer connecting)
- Open the developer console
- Toggle network connectivity
- Observe the page doesn't recover and requires a refresh
Contributor guide
First steps
- Read the whole issue, then the project's contributing guide.
- Comment on the issue to say you are picking it up — it saves two people doing the same work.
- Fork the repository and make your change on a branch.
- Open a pull request that references the issue number.
Assessment
This issue has not been assessed yet.