Repository navigation
[stable35] fix(indexedDB): close the database when the editor closes - #9632
Open
backportbot[bot] wants to merge 7 commits into
Open
backportbot[bot] wants to merge 7 commits into
backportbot[bot] wants to merge 7 commits into
Conversation
A typo set `hasConnectionIssues` instead of `hasConnectionIssue`. After a connection issue, a push rejected with 403 kept showing "The document could not be loaded" instead of "You've been disconnected from the server". With the flag cleared, the connection issue watcher made the editor editable again 200 ms later, although the rejected session had switched it to read-only. The watcher now only re-enables editing in edit mode. This also keeps documents that were opened read-only from becoming editable after a connection issue. A sync answered after the rejection could set the connection issue flag again and bring back the old message. The status card now shows the disconnected state first. Signed-off-by: Jonas <jonas@freesources.org> Assisted-by: ClaudeCode:claude-opus-5-5
Every opened document left its IndexedDB connection and awareness interval open after the editor was closed. Navigating between pages piled up dangling connections and timers. Destroy the ydoc in `close()`. Its destroy event closes the IndexedDB connection and stops the awareness interval. Skip reading from the database once the ydoc is destroyed. Signed-off-by: Jonas <jonas@freesources.org> Assisted-by: ClaudeCode:claude-opus-5-5
…cting When coming back online, the sync response retried the push while the save was still pushing the same steps. The server stored them twice, so the save only covered the first copy. The autosave scheduled for the second one was then cancelled when the save finished, leaving the document at "Unsaved changes". - SyncService: sendStepsNow joins a push in flight instead of sending the outbox again. sendRemainingSteps waits for it and pushes any steps that remain, so saving and closing still send everything. - SaveService: clear the pending autosave before emitting the save event, and only when the save succeeded. - useSaveService: after a save, schedule an autosave if newer changes were pushed in the meantime. Fixes the flaky autosave e2e test "saves after being disconnected for 2 minutes". Signed-off-by: Jonas <jonas@freesources.org> Assisted-by: ClaudeCode:claude-opus-5-5
Destroying the sync provider on close sends a last awareness step after the connection was already cleared. It started the 200 ms send interval, which only stopped after a push, so every closed editor left an interval running that kept the sync service reachable. The interval now stops once there is no connection; the next step after reconnecting starts a new one. The beforeunload listener stayed registered if the editor was closed with unsaved changes, because only the dirty watcher removed it and watchers no longer run after unmounting. Signed-off-by: Jonas <jonas@freesources.org> Assisted-by: ClaudeCode:claude-opus-5-5
…stener Yjs sets `Doc.isDestroyed` before it emits `destroy`, so the composable no longer tracks the destroyed ydoc in its own flag. The local flag now only records that the data was cleared, which also closes the database while the ydoc stays alive. The early return in `whenSynced` could not run: y-indexeddb never emits `synced` once it is destroyed, so `whenSynced` does not settle for a ydoc destroyed before the initial load. Signed-off-by: Jonas <jonas@freesources.org> Assisted-by: ClaudeCode:claude-opus-5-5
Saving pushes the local changes first. If the server rejects that push, the session is invalidated and the connection cleared, but the save went ahead with it and failed with "Cannot read properties of undefined (reading 'shareToken')". Check the connection after pushing instead. Signed-off-by: Jonas <jonas@freesources.org> Assisted-by: ClaudeCode:claude-opus-5-5
The status cards for connection issues, a rejected session or a conflict are added and removed as the state changes and use role="note", so screen readers did not announce them. The always rendered status wrapper is now a polite live region. Signed-off-by: Jonas <jonas@freesources.org> Assisted-by: ClaudeCode:claude-opus-5-5
backportbot
Bot
requested review from
max-nextcloud,
mejo- and
silverkszlo
as code owners
November 18, 2026 15:11
mejo-
approved these changes
Nov 18, 2026
mejo-
enabled auto-merge
November 18, 2026 15:14
Codecov Report❌ Patch coverage is
📢 Thoughts on this report? Let us know! |
This branch has not been deployed
This file contains hidden or 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
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.
Backport of PR #9630