Desktop: Fixes #16167: Fix conflict created when syncing a just-published note - #16182
Open
personalizedrefrigerator wants to merge 11 commits into
Open
Conversation
just-published note See laurent22#16167
Contributor
|
@personalizedrefrigerator the pull request title does not match the required format. Please prefix the title with the area you are targeting, then add the issue you are addressing. If the change targets several areas, separate them with commas. For example:
See the pull request template for the list of valid prefixes and the full specification. This PR has been left open — please update the title when you have a moment. |
…and deleted notes
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.
Problem
Currently, downloading a newly-published note (with remote changes to the title or body) creates a conflict. This happens even if the note has no local changes.
Currently, when an existing note has been changed and published remotely:
Folder::updateAllShareIdsis called at the beginning of sync, with the new share state from the server.Folder::updateAllShareIdssetsis_shared = 1on the note.This seems to be a regression from #15276.
Solution
Change what happens in
updateAllShareIds:is_sharedfor folders and sub-folders.is_sharedfor notes until after the sync upload/delta+download steps have completed. The "resync if there are changes" logic should handle uploading newis_sharedchanges (if any).Fixes #16167.
Testing
Sync fuzzer
sample-fuzzer-setup.jsonto:{ "clientCount": 1, "description": "Changes a note, then publishes it", "actions": [ "// Setup: Start with two clients on the same account", ["switchClient", { "id": 0 }], ["newNote", { "id": "11111111111111111111111111111110" }], ["newClientOnSameAccount", { "welcomeNoteCount": 0 }], "syncAndCheckState", "// Change a note, then publish it", ["updateNoteBody", { "id": "11111111111111111111111111111110"}], ["publishNote", { "id": "11111111111111111111111111111110" }], "syncAndCheckState" ] }yarn syncFuzzer start --setup packages/tools/fuzzer/sample-fuzzer-setup.json.syncAndCheckStatestep.Manual
Publishing and changing a single note no longer creates a conflict (compare with #16167):
Screen.Recording.2026-08-10.at.12.54.08.PM.mov
Publishing a notebook is still possible:
Screen.Recording.2026-08-10.at.12.51.53.PM.mov