Skip to content

[stable31] fix(sync): send first update without initial document state - #7790

Merged
mejo- merged 3 commits into
stable31from
backport/7787/stable31
Oct 16, 2025
Merged

[stable31] fix(sync): send first update without initial document state#7790
mejo- merged 3 commits into
stable31from
backport/7787/stable31

Conversation

@backportbot

@backportbotbackportbotBot commented Oct 16, 2025

Copy link
Copy Markdown

Backport of #7787

Todo

  • Review and resolve any conflicts
  • Amend HEAD commit to remove the line stating to skip CI

Learn more about backports at https://docs.nextcloud.com/server/stable/go.php?to=developer-backports.

Process initial document state as incoming message.
This way it will be tracked as received from the remote server by y-websocket
and the update send to the server will exclude it.
Also use the sync services `opened` event inside WebsocketPolyfill
rather than mixing async `syncService.open().then` and event handling.
This allows us to emit `opened` and then `sync` from `syncService.open()`.
Signed-off-by: Max <max@nextcloud.com>
@mejo-
mejo-force-pushed the backport/7787/stable31 branch from 7b1d02f to dcaef41CompareOctober 16, 2025 11:22
@mejo-
mejo- marked this pull request as ready for review October 16, 2025 11:22
@codecov

codecovBot commented Oct 16, 2025

Copy link
Copy Markdown

Codecov Report

❌ Patch coverage is 34.61538% with 17 lines in your changes missing coverage. Please review.
✅ Project coverage is 51.35%. Comparing base (a6f16d4) to head (d0da538).
⚠️ Report is 4 commits behind head on stable31.

Files with missing linesPatch %Lines
src/services/SyncService.ts14.28%12 Missing ⚠️
src/services/WebSocketPolyfill.ts50.00%4 Missing ⚠️
src/helpers/yjs.ts50.00%1 Missing ⚠️
Additional details and impacted files
@@ Coverage Diff @@## stable31 #7790 +/- ##
============================================
- Coverage 51.36% 51.35% -0.01% 
============================================
Files 291 291 Lines 41660 41673 +13 Branches 868 867 -1 ============================================
+ Hits 21399 21403 +4 - Misses 20142 20151 +9 
Partials 119 119 

☔ 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.

* Emit the documents last saved version in the push response
if document state is send as well.
* Otherwise send the version as 0 so it cannot increase the sync service version.
* Use the versions returned by create and push requests alongside the document state
to construct a consistent step with the last saved version that matches the document state.
This will result in the sync service version getting bumped
to the documents last saved version
once the coresponding document state has been processed.
Signed-off-by: Max <max@nextcloud.com>
Signed-off-by: Max <max@nextcloud.com>
Signed-off-by: Jonas <jonas@freesources.org>
@mejo-
mejo- merged commit 4a8617d into stable31Oct 16, 2025
66 of 68 checks passed
@mejo-
mejo- deleted the backport/7787/stable31 branch October 16, 2025 13:33
Sign up for freeto join this conversation on GitHub. Already have an account? Sign in to comment

Labels

Projects

None yet

Development

Successfully merging this pull request may close these issues.

2 participants

@mejo-@max-nextcloud