spacebarchat / spacebarchat/server

Server does not shutdown properly

Open
#1,292 0 comments 0 reactions 0 assignees View on GitHub

Nobody has claimed this yet.

Dominant language
TypeScript
Stars
2.2k
Forks
323
Avg merge
14h 48m
Merged PRs (30d)
4

Description

Describe the bug
Currently a server shutdown does not await for websocket connections to close. This means that certain session cleanup code in the websocket Close event does not get executed

We probably need to await this:
https://github.com/spacebarchat/server/blob/f03c6209a42ae3e922bdb86954de04f1ae6daaa8/src/gateway/Server.ts#L85

To Reproduce
Steps to reproduce the behavior:

  1. Shutdown the server
  2. Server will shutdown immediately without waiting for websocket connections to close

Expected behavior
The server should wait for websocket connections to close before shutting down

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.

Research direction

Start at src/gateway/Server.ts around line 85, where server shutdown is initiated. Reproduce a shutdown with an active websocket connection and verify that shutdown waits for the connection to close so its websocket Close event cleanup executes before the server exits.

Written by the indexing model from the issue text.

Assessment

Tech stack
typescript
Domain
backend
Issue type
Bug
Difficulty
2/5
Estimated time
1-3 hours
Activity status
Stale
Clarity
Clearly specified
Newbie friendliness
58/100

Get new issues in your inbox

A short digest of beginner-friendly GitHub issues.