Skip to content

Conversation

@max-nextcloud
Copy link
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
  • 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.
    • Test... start editing offline, overwrite file in other tab, see what happens when getting back online @max-nextcloud
  • Opening editor: steps from IndexedDB that didn't get sent to server yet need to get pushed
  • Opening editor: when steps from IndexedDB didn't get sent to server yet, unsaved changes should be indicated and saved
  • cleanup yDoc file server-side when file is deleted @mejo-
  • cleanup client side state for deleted files
  • config flag

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

codecov bot commented Sep 8, 2025

Codecov Report

❌ Patch coverage is 31.81818% with 15 lines in your changes missing coverage. Please review.
✅ Project coverage is 46.98%. Comparing base (67d597f) to head (62c82f5).

Files with missing lines Patch % Lines
src/services/SyncService.ts 12.50% 6 Missing and 1 partial ⚠️
src/helpers/yjs.ts 0.00% 3 Missing and 1 partial ⚠️
src/composables/useConnection.ts 71.42% 1 Missing and 1 partial ⚠️
src/services/WebSocketPolyfill.ts 33.33% 2 Missing ⚠️
Additional details and impacted files
@@            Coverage Diff             @@
##             main    #7621      +/-   ##
==========================================
- Coverage   47.06%   46.98%   -0.09%     
==========================================
  Files         141      141              
  Lines        3886     3893       +7     
  Branches      733      735       +2     
==========================================
  Hits         1829     1829              
- Misses       1763     1768       +5     
- Partials      294      296       +2     

☔ View full report in Codecov by Sentry.
📢 Have feedback on the report? Share it here.

🚀 New features to boost your workflow:
  • ❄️ Test Analytics: Detect flaky tests, report on failures, and find test suite problems.
  • 📦 JS Bundle Analysis: Save yourself from yourself by tracking and limiting bundle sizes in JS merges.

For now text is sometimes duplicated

Signed-off-by: Max <[email protected]>
Keep the baseVersionEtag and the editing session around
in case people who are offline connect again later.

Signed-off-by: Max <[email protected]>
... and use it to check if the server is still on the same session.

Signed-off-by: Max <[email protected]>
When reopening a document that was edited offline
it will also be considered dirty now.

Autosave will not kick in yet... As no steps are pushed.
But when closing the file it will be saved.

Signed-off-by: Max <[email protected]>
If no changes have been made offline
clear the indexedDb cache
and reload Editor.vue
to load the latest editing session from the server.

Signed-off-by: Max <[email protected]>
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.

Persist document state in browser IndexedDB storage

2 participants