learningequality / learningequality/studio

Implement defensive handling of websocket connection

Open
#3,657 0 comments 0 reactions 1 assignee View on GitHub

@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

Steps to reproduce the issue

  1. Open a channel on the websocket server https://websockets.studio.learningequality.org/ (note: seems like it's no longer connecting)
  2. Open the developer console
  3. Toggle network connectivity
  4. Observe the page doesn't recover and requires a refresh

Contributor guide

Open the contributing guide

First steps

  1. Read the whole issue, then the project's contributing guide.
  2. Comment on the issue to say you are picking it up — it saves two people doing the same work.
  3. Fork the repository and make your change on a branch.
  4. Open a pull request that references the issue number.

Assessment

This issue has not been assessed yet.

Get new issues in your inbox

A short digest of beginner-friendly GitHub issues.