spacebarchat / spacebarchat/server
Server does not shutdown properly
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:
- Shutdown the server
- 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
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.
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