Skip to content

enh/y indexeddb#7621

Open
max-nextcloud wants to merge 52 commits intomainfrom
enh/y-indexeddb
Open

enh/y indexeddb#7621
max-nextcloud wants to merge 52 commits intomainfrom
enh/y-indexeddb

Conversation

@max-nextcloud
Copy link
Copy Markdown
Collaborator

@max-nextcloud max-nextcloud commented Sep 8, 2025

TODOs

  • Think through other file operations.
  • Typing without network, closing the editor, opening it again: no content lost
  • After closing and opening the editor, undo history is empty
  • cleanup yDoc file server-side when file is deleted @mejo-
  • Add base_version_etag as custom property to IndexedDB
    • After loading document from IndexedDB, send baseVersionEtag as part of create request
    • In case of conflict, use existing manual conflict handling
    • After manual conflict handling, reset y-indexeddb provider for document
    • Fix endless reload loop when base version has been cleared:
      • Open file with version in indexed db but on a different baseVersionEtag.
      • Different versions are detected. Reload button is offered.
      • Reload does not change the indexed db content - so conflict persists.
    • migrate change mime type test to playwright
    • debug failing change mime type test.
    • make bc channel depend on base version etag.
    • Test... start editing offline, overwrite file in other tab, see what happens when getting back online @max-nextcloud
  • Handling conflicts when opening file that was changed offline
    • detect conflict
    • handle scenario with no local changes well
    • display conflict when local changes were made
    • adjust conflict dialog wording
    • test conflict resolutions work
  • Reconnecting: saved unsaved changes:
    • indicate dirty state
    • autosave when opening dirty file
    • autosave when reconnecting with editing session open
    • push steps that have not been pushed yet
  • make "no conflict when uploading identical content" work again (@mejo-)
  • cleanup client side state for deleted files (possibly a follow-up)
  • improve wording for conflict resolution buttons (@silverkszlo, possibly a follow-up if too complex)
    • check if the distinction in readerSource property for CollissionResolveDialog is still needed (see here)
  • test in private browser tab and research whether indexeddb is supported there (@silverkszlo)
  • keep editor editable when connection issue got detected (@mejo-)

@max-nextcloud max-nextcloud requested a review from mejo- as a code owner September 8, 2025 09:44
@codecov
Copy link
Copy Markdown

codecov Bot commented Sep 8, 2025

@max-nextcloud max-nextcloud force-pushed the enh/y-indexeddb branch 7 times, most recently from 6637691 to e746625 Compare October 27, 2025 20:17
@max-nextcloud max-nextcloud force-pushed the enh/y-indexeddb branch 5 times, most recently from 6d4c06b to 1ade042 Compare November 5, 2025 15:56
@max-nextcloud max-nextcloud force-pushed the enh/y-indexeddb branch 4 times, most recently from 853ca71 to 0a18ad3 Compare November 6, 2025 19:56
@mejo- mejo- self-assigned this Dec 3, 2025
@mejo-
Copy link
Copy Markdown
Member

mejo- commented Dec 3, 2025

  • cleanup yDoc file server-side when file is deleted @mejo-

Turns out this already happens and we don't have to change anything:

$this->documentService->resetDocument($node->getId(), true);

max-nextcloud and others added 16 commits April 23, 2026 10:18
The pushing does not happen yet - thus the test is failing.

Signed-off-by: Max <max@nextcloud.com>
Expose the update mechanism inside the websocket provider.
This is normally triggered by updates of the ydoc.
But as the updates happened while offline in a previous session
we need to trigger it explicitely.

The websocket provider holds the remote state of the document.
So it can compute an update based on this and the current ydoc.

Signed-off-by: Max <max@nextcloud.com>
…ode)

Signed-off-by: silver <s.szmajduch@posteo.de>
… (ai code)

Signed-off-by: silver <s.szmajduch@posteo.de>
Signed-off-by: silver <s.szmajduch@posteo.de>
Signed-off-by: silver <s.szmajduch@posteo.de>
Signed-off-by: silver <s.szmajduch@posteo.de>
Signed-off-by: silver <s.szmajduch@posteo.de>
Signed-off-by: silver <s.szmajduch@posteo.de>
Signed-off-by: silver <s.szmajduch@posteo.de>
There might still be dangling async functions trying to write to
IndexedDB after `clearIndexedDB()` was called. Guard against these race
conditions.

Generated with the help of AI but verified and implemented manually.

Signed-off-by: Jonas <jonas@freesources.org>
Needed so local changes don't get lost when editor is closed in
case of conflict.

Signed-off-by: Jonas <jonas@freesources.org>
Signed-off-by: Jonas <jonas@freesources.org>
Signed-off-by: Jonas <jonas@freesources.org>
Signed-off-by: silver <s.szmajduch@posteo.de>
@mejo- mejo- force-pushed the enh/y-indexeddb branch 4 times, most recently from f4a20a8 to ca0bda6 Compare April 23, 2026 12:21
Comment thread lib/Listeners/NodeWrittenResetDocumentListener.php Outdated
@mejo- mejo- force-pushed the enh/y-indexeddb branch from ca0bda6 to d83ce8a Compare April 23, 2026 12:57
mejo- and others added 5 commits April 23, 2026 15:01
Fixes 'no conflict when uploading identical content with unsaved
changes'

Signed-off-by: Jonas <jonas@freesources.org>
…alog

Rename buttons to hopefully make them more understandable.

Signed-off-by: silver <s.szmajduch@posteo.de>
Signed-off-by: Jonas <jonas@freesources.org>
Signed-off-by: Jonas <jonas@freesources.org>
@mejo- mejo- force-pushed the enh/y-indexeddb branch from d83ce8a to 33cc183 Compare April 23, 2026 13:01
mejo- added 2 commits April 23, 2026 15:20
Signed-off-by: Jonas <jonas@freesources.org>
Requests might take a few seconds before getting triggered once we're
back online.

Signed-off-by: Jonas <jonas@freesources.org>
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

Status: 🏗️ In progress

Development

Successfully merging this pull request may close these issues.

Persist document state in browser IndexedDB storage

4 participants