Skip to content

Add runnable WebSocket sync example - #19

Merged
nmndwivedi merged 1 commit into
quickdrawjs:mainfrom
pttydou:example/sync-websocket-relay
Sep 19, 2026
Merged

nmndwivedi merged 1 commit into
quickdrawjs:mainfrom
pttydou:example/sync-websocket-relay

Conversation

@pttydou

@pttydou pttydou commented Aug 29, 2026

Copy link
Copy Markdown
Contributor

What & why

Fixes #4.

Adds a runnable sync workspace with two boards connected through a byte-only WebSocket relay. Local user diffs are broadcast with the store's source filter, and received diffs are applied as remote so each client's undo history stays local. This v1 example uses record-level last-writer-wins and intentionally has no persistence or CRDT.

Verified with npm test, npm run typecheck, npm run build, and a two-client Edge browser smoke test.

Checklist

  • Tests added or updated (npm test passes)
  • Type declarations updated if the public API changed (npm run typecheck)
  • RN WebView bundle regenerated if core changed (npm run build)
  • No new runtime dependencies in @quickdrawjs/core

@vercel

vercel Bot commented Aug 29, 2026

Copy link
Copy Markdown

@pttydou is attempting to deploy a commit to the naman's projects Team on Vercel.

A member of the Team first needs to authorize it.

@nmndwivedi nmndwivedi left a comment

Copy link
Copy Markdown
Collaborator

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Clean, self-contained example: relay is byte-only, path traversal is guarded, and the undo-isolation test covers the important bit. Lockfile change is just the workspace link (ws was already in the tree). Tests + typecheck pass on top of current main. Thanks!

@nmndwivedi
nmndwivedi merged commit 729e098 into quickdrawjs:main Sep 19, 2026
1 of 2 checks passed
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.

Example: real-time sync over a WebSocket relay

2 participants