Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Support yjs in dexie-cloud-addon #2045

Open
wants to merge 48 commits into
base: master
Choose a base branch
from
Open

Conversation

dfahlander
Copy link
Collaborator

No description provided.

dfahlander and others added 30 commits June 10, 2024 19:39
Still need to think it through. Might need to find a better way than iterating all updates in entire DB periodically.
Could not take latest as it generates double types. Found out we needed version 9.3.1 exactly.
* Renamed updTable to updatesTable
* Renamed id / rowId to parentId
* To lookup whether a certain document is open and find it
* updates
* awareness
* sync
* websocket
Move all yjs related modules to an yjs directory
* updatesTable is not meaningful outside of client
* server need to know the parent table to verify access
* parent table + yDoc prop combined forms the same uniqueness as updatesTable.
David Fahlander added 18 commits August 23, 2024 14:16
Referring to dexie-cloud-common a better way for pnpm: with workspace:^
* Update receivedUntil after getting server changes over syncWithServer() but not when getting chaotic server changes on a particular document over websocket.
* Before syncWithServer, compute an Y.js state vector from the server changes that has arrived after receivedFrom so that the server can avoid sending the same changes back.
* Update YSyncState after sync with the correct unsentFrom and receivedUntil values.
useYProvider() back to useDocument()
because the hook not only maintains a provider but also manages the lifetime of the document, keeping it loaded as long as the component is mounted.
* Opening a document on the server, providing a state vector of updates that we've got from the server over websocket but not through regular sync.
* Handling doc-open re-requests in case WebSocket goes down and up again while the document is open in an editor.
* Don't send the initial awareness state - wait for editor to manage awarenesses - except when the component is unmounted - then we remove our "client" from awareness state and also send a "doc-close" message
Store serverRevision on sync state for Y-tables in order to include it in the DocOpen request so that the client can get additional updates since last sync over the websocket immediately when the document is opened.
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.

1 participant