feat: websocket integration#486
Open
nahSystemu wants to merge 36 commits intokanbn:mainfrom
Open
Conversation
…anged in EventsProvider
…uter into handler
…inding, host config
…-websocket-secret header
…ple and turbo.json
Contributor
Author
|
@hjball Handing this off to you, needs some updating prior to merging, spent an hour already fixing merge conflicts and thought I was on latest, but can see that its 15 commits behind, so good luck. Test it on your end, see how it works, if anything is off tell me, I'll remove or change what needs to be changed |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Add this suggestion to a batch that can be applied as a single commit.This suggestion is invalid because no changes were made to the code.Suggestions cannot be applied while the pull request is closed.Suggestions cannot be applied while viewing a subset of changes.Only one suggestion per line can be applied in a batch.Add this suggestion to a batch that can be applied as a single commit.Applying suggestions on deleted lines is not supported.You must change the existing code in this line in order to create a valid suggestion.Outdated suggestions cannot be applied.This suggestion has been applied or marked resolved.Suggestions cannot be applied from pending reviews.Suggestions cannot be applied on multi-line comments.Suggestions cannot be applied while the pull request is queued to merge.Suggestion cannot be applied right now. Please check back later.
Summary
Closes #7
This PR adds a WebSocket server to Kan and wires it up across the API and frontend to enable real-time updates for everyone on a workspace.
The server sits as its own service alongside the API and handles event delivery. When a mutation happens — a card is moved, a comment is added, a label changes, anything — the API publishes an event to the WebSocket server, which fans it out to all connected clients watching that workspace. On the frontend, the relevant queries are invalidated and the UI updates automatically. To avoid unnecessary re-fetches, each event includes the ID of the user who triggered it so clients can skip updates they caused themselves. Subscriptions are also scoped to the active board so clients aren't processing events that have nothing to do with what they're looking at.
A few things worth noting about the implementation:
Alongside the core event system, this also adds a presence indicator in the board toolbar (live viewer avatars), an in-app notification inbox for things like card assignments and comments, and rate limiting on high-frequency card mutations. Webhook coverage was also expanded to include boards, lists, labels, and comments while the infrastructure was being touched.
How did you test this change?
Tested locally via Docker Compose with the full stack running. Verified live updates across multiple browser tabs for all major mutation types, presence updates, and notification delivery. Offline queuing was tested by disabling the network mid-session and confirming mutations replayed correctly on reconnect.