learningequality / learningequality/studio

Implement ping/keep-alive messages to prevent websocket connection closure

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

@ozer550 is already working on this.

Since Oct 11, 2022.

DEV: backend DEV: frontend TAG: new feature
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

Observed behavior

  • The connection could timeout from becoming idle causing Cloudflare and/or Google Load Balancer to close the connection

Expected behavior

  • We send periodic messages that will keep the connection alive
  • The periodicity should be easily configurable, and should default to 25 seconds initially
  • A bonus would be to limit these messages to only occur if any other messages hadn't been sent during the period timeframe

User-facing consequences

  • Without these messages, we'd need to rely on connection handling to keep reopening the connection which could cause unnecessary overhead

Additional information

  • Addressing this first will help us iterate and be sure that nothing else is needed to keep the connection alive, before adding defensive handling to the frontend to keep it connected
  • I'm unsure if we also need the server side to respond to these messages to keep the connection alive

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 JS console
  3. Observe leaving it idle, then performing edits, causes error about connection being closed

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.