tldraw/packages/tlsync
David Sheldrick f2827f6409
Allow clients to gracefully handle rejection (#3673)
This PR fixes the issue where sync clients would get into a reconnect
loop after being rejected by the sync server.

- Close the socket when in the error state (see useRemoteSyncClient)
- Show a 'plx refresh the page' screen that doesn't have a sad face on
it.
  
<img width="665" alt="image"
src="https://github.com/tldraw/tldraw/assets/1242537/96025fa3-cc20-4f53-8f58-74e473e16702">

- If older clients who can't handle rejection well need to be rejected
(e.g. due to a store migration being added) then we send them to a
special purgatory where the canvas goes blank and it shows the offline
indicator but the websocket connection stays open and it won't try to
reconnect.

### Change Type

- [x] `dotcom` — Changes the tldraw.com web app
- [x] `bugfix` — Bug fix


### Test Plan

1. Gonna manually test this one by doing sneaky deploys to a test PR
2024-05-02 13:54:21 +00:00
..
src Allow clients to gracefully handle rejection (#3673) 2024-05-02 13:54:21 +00:00
api-extractor.json unbrivate, dot com in (#2475) 2024-01-16 14:38:05 +00:00
CHANGELOG.md unbrivate, dot com in (#2475) 2024-01-16 14:38:05 +00:00
LICENSE.md unbrivate, dot com in (#2475) 2024-01-16 14:38:05 +00:00
package.json Revert "squish sync data events before sending them out" (#3331) 2024-04-03 10:31:28 +01:00
README.md unbrivate, dot com in (#2475) 2024-01-16 14:38:05 +00:00
setupJest.js React-powered SVG exports (#3117) 2024-03-25 14:16:55 +00:00
tsconfig.json Check tsconfig "references" arrays (#2891) 2024-02-21 13:07:53 +00:00

@tldraw/tlsync