Skip to content

feat: safe reconnect for collaborative editor - #1023

Open
pimaster900 wants to merge 1 commit into
StellarDevHub:mainfrom
pimaster900:feat/collaborative-editor-safe-reconnect
Open

feat: safe reconnect for collaborative editor#1023
pimaster900 wants to merge 1 commit into
StellarDevHub:mainfrom
pimaster900:feat/collaborative-editor-safe-reconnect

Conversation

@pimaster900

Copy link
Copy Markdown
  • Add useCollaborativeEditor hook with singleton provider registry (one Y.Doc + WebsocketProvider per roomId/userId pair, refcounted)
  • Add PendingUpdateQueue utility that buffers local Yjs updates while disconnected, deduplicates by content key, and caps at 100 entries
  • Replay queued updates into the shared doc on reconnect (FIFO order)
  • Expose hasConflict flag when remote state advanced while offline
  • Expose reconnectStatus ('connected' | 'disconnected' | 'reconnecting')
  • Full teardown on last consumer unmount (disconnect + destroy)
  • Add ReconnectBanner component with accessible live regions (role=status / role=alert), actionable copy, and responsive desktop/mobile layout
  • Update CollaborativeCanvas to use new hook and banner; all existing node/edge/export/awareness behaviour preserved
  • Add vitest unit tests for hook (singleton, queue, conflict, teardown, reconnect(), dismissConflict())
  • Add vitest integration tests simulating disconnect → offline edits → reconnect → replay without duplicates

closes #935

- Add useCollaborativeEditor hook with singleton provider registry
  (one Y.Doc + WebsocketProvider per roomId/userId pair, refcounted)
- Add PendingUpdateQueue utility that buffers local Yjs updates while
  disconnected, deduplicates by content key, and caps at 100 entries
- Replay queued updates into the shared doc on reconnect (FIFO order)
- Expose hasConflict flag when remote state advanced while offline
- Expose reconnectStatus ('connected' | 'disconnected' | 'reconnecting')
- Full teardown on last consumer unmount (disconnect + destroy)
- Add ReconnectBanner component with accessible live regions (role=status
  / role=alert), actionable copy, and responsive desktop/mobile layout
- Update CollaborativeCanvas to use new hook and banner; all existing
  node/edge/export/awareness behaviour preserved
- Add vitest unit tests for hook (singleton, queue, conflict, teardown,
  reconnect(), dismissConflict())
- Add vitest integration tests simulating disconnect → offline edits →
  reconnect → replay without duplicates
@vercel

vercel Bot commented Jul 30, 2026

Copy link
Copy Markdown

@pimaster900 is attempting to deploy a commit to the Ayomide Adeniran's projects Team on Vercel.

A member of the Team first needs to authorize it.

@drips-wave

drips-wave Bot commented Jul 30, 2026

Copy link
Copy Markdown

@pimaster900 Great news! 🎉 Based on an automated assessment of this PR, the linked Wave issue(s) no longer count against your application limits.

You can now already apply to more issues while waiting for a review of this PR. Keep up the great work! 🚀

Learn more about application limits

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

[Collaboration] Add reconnect-safe document synchronization for collaborative labs

1 participant