clockworklabs / clockworklabs/SpacetimeDB
Add parameter to disconnect reducer or ReducerContext to indicate type of connection
Nobody has claimed this yet.
- Dominant language
- Rust
- Stars
- 25.2k
- Forks
- 1.1k
- Avg merge
- 2d 7h
- Merged PRs (30d)
- 46
Description
Right now there isn't an easy way to tell if disconnect reducer gets called because a WebSocket client disconnects (which may require some sign-out logic), or if it's caused by an HTTP request (which, obviously, doesn't need to go through the same logic). Having a way to differentiate between the two would allow us to handle those cases differently. ReducerContext seems like a good place for it and would also allow similar treatment inside "regular" reducers.
Contributor guide
No contributing guide indexed for this repository
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 by tracing the disconnect reducer and ReducerContext entry points to determine where the connection source is available. Define how the WebSocket-versus-HTTP distinction should be exposed to disconnect and regular reducers, then verify that both paths receive the correct connection type.
Written by the indexing model from the issue text.
Assessment
- Tech stack
- rust
- Domain
- backend-api-design
- Issue type
- Feature
- Difficulty
- 4/5
- Estimated time
- 3-5 days
- Activity status
- Stale
- Clarity
- Mostly clear
- Newbie friendliness
- 35/100