-
-
Notifications
You must be signed in to change notification settings - Fork 642
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
dfahlander
wants to merge
48
commits into
master
Choose a base branch
from
support-yjs-dexie-cloud
base: master
Could not load branches
Branch not found: {{ refName }}
Loading
Could not load tags
Nothing to show
Loading
Are you sure you want to change the base?
Some commits from the old base branch may be removed from the timeline,
and old review comments may become outdated.
Open
Conversation
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
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.
Referring to dexie-cloud-common a better way for pnpm: with workspace:^
…n compressing docs.
* 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
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.
No description provided.