Repository navigation
fix(sync): skip the push round that only reports our own upload - #32
Merged
Merged
Conversation
Every upload brought the server's push notice for it a few seconds later, and that notice ran a whole remote-delta round (loading the baseline, then listing down to the file) only to find what we had just written. With a file uploaded every 10 minutes that was a round every 10 minutes for nothing. The push client now asks notify_push for the changed file ids, and the engine remembers the id each upload got from the server for 2 minutes. When a push only reports our own uploads, plus the folder each one went into (Nextcloud updates the folder's entry as well), the round is skipped. A plain notify_file, any id we don't recognise, or a sync asked for in the same window still runs the round as before. Deck d1103.
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.
Every upload brought the server's push notice for it a second or so later, and that notice ran a whole remote-delta round (loading the baseline, then listing down to the file) only to find what we had just written.
The push client now sends
listen notify_file_idso notify_push says which files changed, and each upload records the file id the server gave it for 2 minutes. When a push only reports our own uploads, plus the folder each one went into, the round is skipped. A plainnotify_file, any id we don't recognise, or any other sync asked for in the same window still runs the round as before.Tested on the Windows 11 VM against a real server in live mode: a new file and an edit both logged "push skipped; the server only reported our own upload" (the notice carried the file and its folder), and a new folder and a delete, which aren't uploads, still ran the round.
Deck d1103.