Repository navigation
Conversation
…oaded The drive registered PARTIAL hydration, which Microsoft documents as not supported and which Windows runs as PROGRESSIVE (the default for programs; the higher of the two applies). PROGRESSIVE lets a read through as soon as its bytes arrive and finishes the download a moment later. A write in between could lose the downloaded bytes: on CI, the read and append in UpdatePlaceholderContractTest read back as 11 zeros followed by the appended text (runs 45843777423 and 45879816676). It showed only on CI. On a PC, Defender's real-time protection downloads a file as soon as a program opens it for reading, so the test's own read never drove the download; CI runners turn real-time monitoring off. Reproduced locally by reading through a handle opened before the file was freed up: 9 of 9600 rounds read back as zeros with PARTIAL, none with FULL. FULL is what Nextcloud (cfapiwrapper.cpp) and OneDrive register: the platform completes a read only once the whole file is local. It also keeps what a program appends to an online-only file, which PARTIAL lost for a 70 KB file. ARead_ReturnsOnlyOnceTheWholeFileIsHere pins it and fails every time with PARTIAL. The E2E mount check now expects the mark to be gone right after the read instead of waiting for it. Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
2 of 3 tasks
Owner
Author
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.
Fixes the intermittent CI failure in
UpdatePlaceholderContractTest, where a file read and then appended to came back as"\0\0\0\0\0\0\0\0\0\0\0-edited"instead of"old-content-edited"(runs 45843777423 attempt 1 and 45879816676). It is a product bug, not only a test race.Cause
The drive registered the
PARTIALhydration policy. Microsoft's reference saysPARTIAL"is not currently supported" and behaves likePROGRESSIVE. The effective policy is the higher of the program's and the provider's, and programs default toPROGRESSIVE(sync engine docs). UnderPROGRESSIVE, Windows completes a read as soon as its bytes arrive and finishes the download a moment later. A write in that gap can lose the downloaded bytes. Any program that reads a file and writes to it at once could hit this, and the engine would then upload the zeros as an edit.It only failed on CI. On a PC, Defender's real-time protection downloads the whole file as soon as a program opens it, so the test's own read never starts the download. GitHub's runners turn real-time monitoring off (Configure-WindowsDefender.ps1), so there the read starts it and the gap is there. Coverage most likely just changes the timing.
Evidence (local, with temporary experiments not included here)
To get past Defender, the reader is opened while the file is downloaded, the file is freed up through a
WRITE_DAC-only handle, and then the reader reads it.PARTIAL(before)FULL(after)RECALL_ON_DATA_ACCESSset) right after the read-edited(8 parallel workers × 400 rounds × 3 runs)Nextcloud registers
CF_HYDRATION_POLICY_FULL(src/libsync/vfs/cfapi/cfapiwrapper.cpp), and OneDrive's sync roots on the test PC are registeredFull.Changes
SyncRootRegistrarregistersFULLin both the shell path and theCfRegisterSyncRootfallback. Existing drives pick it up when the service re-registers at startup.UpdatePlaceholderContractTest.ARead_ReturnsOnlyOnceTheWholeFileIsHere. It does not depend on timing: it failed 8 of 8 runs underPARTIALand passed 8 of 8 underFULL.docs/architecture.mdexplains the policy choice.Side effect: under
PARTIAL, appending to a never-downloaded 70 KB file lost the appended bytes. UnderFULLthe file is downloaded first and they are kept.Test plan
dotnet test .\OpenCfDrive.slnx --settings coverage.runsettings: 282 passed locally (twice, before and after rebasing on main)PARTIAL(8/8) and passes underFULL(8/8)Merges with PR #11 without conflicts (checked with
git merge-tree).🤖 Generated with Claude Code