Skip to content

Conversation

@backportbot
Copy link

@backportbot backportbot bot commented Oct 16, 2025

Backport of PR #7787

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 <[email protected]>
* 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 <[email protected]>
@codecov
Copy link

codecov bot commented Oct 16, 2025

Codecov Report

❌ Patch coverage is 36.00000% with 16 lines in your changes missing coverage. Please review.
✅ Project coverage is 60.24%. Comparing base (7bb3703) to head (3a02747).
⚠️ Report is 5 commits behind head on stable32.

Files with missing lines Patch % Lines
src/services/SyncService.ts 14.28% 12 Missing ⚠️
src/services/WebSocketPolyfill.ts 50.00% 4 Missing ⚠️
Additional details and impacted files
@@             Coverage Diff              @@
##           stable32    #7791      +/-   ##
============================================
+ Coverage     51.93%   60.24%   +8.31%     
============================================
  Files           502      501       -1     
  Lines         43679    38601    -5078     
  Branches       1145     1133      -12     
============================================
+ Hits          22683    23254     +571     
+ Misses        20881    15241    -5640     
+ Partials        115      106       -9     

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

We now return 0 as long as no document state is send.

Signed-off-by: Max <[email protected]>
@mejo- mejo- merged commit e973205 into stable32 Oct 16, 2025
68 of 69 checks passed
@mejo- mejo- deleted the backport/7787/stable32 branch October 16, 2025 13:16
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Projects

None yet

Development

Successfully merging this pull request may close these issues.

3 participants