[stable31] fix(sync): send first update without initial document state#7790
Merged
[stable31] fix(sync): send first update without initial document state#7790
Conversation
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]>
7b1d02f to
dcaef41
Compare
Codecov Report❌ Patch coverage is
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. 🚀 New features to boost your workflow:
|
dcaef41 to
7d81038
Compare
max-nextcloud
approved these changes
Oct 16, 2025
* 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]>
Signed-off-by: Max <[email protected]> Signed-off-by: Jonas <[email protected]>
7d81038 to
d0da538
Compare
mejo-
approved these changes
Oct 16, 2025
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 #7787
Todo
Learn more about backports at https://docs.nextcloud.com/server/stable/go.php?to=developer-backports.