Repository navigation
fix: sync folders whose space arrives after the account connected - #12770
Open
oc-tmueller wants to merge 4 commits into
Open
oc-tmueller wants to merge 4 commits into
oc-tmueller wants to merge 4 commits into
Conversation
A folder restored from the config stays unavailable until the spaces manager has loaded its space. If the account connects before the drives reply arrives, scheduling on connect skips the folder, and setting it available later did not enqueue it. Nothing else triggers a sync, so local changes made while the client was not running stayed unsynced until something changed on the server or on disk. Enqueue the folder in onSpacesAdded once it can sync. Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
loadSpacesAlone calls onSpacesAdded and then gets spacesAdded for the same spaces, which synced the folder twice. Also capture the test's fake network state by value so a late request cannot read the test's dead locals. Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
FolderDefinition drops the trailing slash of the dav url, and Folder::webDavUrl() asserts that the space url matches it. Release builds compile the assert out, so the test passed locally and aborted in CI. Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
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.
A folder restored from the config starts out unavailable, because the spaces manager has no spaces yet. If the account connects before the
/graph/v1.0/me/drivesreply arrives,FolderMan::slotIsConnectedChanged()skips the folder (canSync()is false). When the space shows up,onSpacesAdded()only calledsetAvailable(true). Nothing enqueued the folder after that, so changes made while the client was down stayed unsynced until something changed on the server or on disk.This is the intermittent GUI test failure in
tst_syncing/test.feature:257("Verify pre existing folders in local (Desktop client) are copied over to the server"), for example in this run on #12762. In that client log the drives request was restarted once, and its reply came 8 ms after "connected, scheduling its folders". The client then sat idle for the full 60 s wait.onSpacesAdded()now enqueues a folder when it goes from unavailable to available and can sync. Doing this only on that transition keepsloadSpacesAlone(), which callsonSpacesAdded()and then getsspacesAddedfor the same spaces, from syncing twice.TestFolderMan::testFolderIsScheduledWhenItsSpaceArrivesAfterConnectreproduces the order: the fake server answers/me/driveswith 503 until the account is connected, then serves the space, and the test expects the pre-existing localFolder1to be uploaded. It fails 5 of 5 runs without the change and passes 5 of 5 with it (macOS arm64, Release).🤖 Generated with Claude Code