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

fix(sync): push local changes on reconnect #5279

Merged
merged 6 commits into from
Jan 19, 2024
Merged
Changes from 1 commit
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
Prev Previous commit
Next Next commit
docs(js): add return type annotations
Signed-off-by: Max <max@nextcloud.com>
  • Loading branch information
max-nextcloud committed Jan 18, 2024
commit a7b61752474406292e55f6517dc72afc4c18a518
2 changes: 2 additions & 0 deletions src/helpers/yjs.js
Original file line number Diff line number Diff line change
Expand Up @@ -32,6 +32,7 @@ import { messageSync } from 'y-websocket'
*
* Used to store yjs state on the server.
* @param {Y.Doc} ydoc - encode state of this doc
* @return {string}
*/
export function getDocumentState(ydoc) {
const update = Y.encodeStateAsUpdate(ydoc)
Expand All @@ -54,6 +55,7 @@ export function applyDocumentState(ydoc, documentState, origin) {
*
* @param {Y.Doc} ydoc - encode state of this doc
* @param {string} encodedBaseUpdate - base64 encoded doc update to build upon
max-nextcloud marked this conversation as resolved.
Show resolved Hide resolved
* @return {string|undefined}
*/
export function getUpdateMessage(ydoc, encodedBaseUpdate) {
const baseUpdate = decodeArrayBuffer(encodedBaseUpdate)
Expand Down
Loading