feat(websocket): implement real-time sync with HMAC authentication an… #1
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.
Real-time WebSocket Sync + Folder Move Fix
Summary
Implements complete WebSocket real-time sync with HMAC authentication and fixes critical folder move sync bug.
Key Changes
folderIdchanges now broadcast properlyArchitecture
src/websocket/
├── auth/handler.ts # JWT + HMAC auth
├── handlers/notes.ts # Note sync (+ folder move fix)
├── middleware/ # Rate limiting & connections
└── index.ts # WebSocket manager
Critical Bug Fix
Before: Moving notes between folders didn't sync to other devices
After: Folder moves broadcast instantly via WebSocket
Root Cause:
folderIdmissing from allowed update fieldsFix: Added to
allowedFieldsarray in note handlerWebSocket Protocol
Environment Variables
WS_RATE_LIMIT_MAX_MESSAGES300WS_MAX_CONNECTIONS_PER_USER20WS_AUTH_TIMEOUT_MS30000Documentation
WEBSOCKET_INTEGRATION.mdwith complete protocol specTesting
Multi-device sync now works for:
Impact