P4-2: Windows provider — Cloud Filter API #45
Labels
No labels
data-integrity
engine
platform
procurement
remote
scaffold
ui
No milestone
No project
No assignees
1 participant
Notifications
Due date
No due date set.
Dependencies
No dependencies set.
Reference: Cordy/cairn-desktop#45
Loading…
Add table
Add a link
Reference in a new issue
No description provided.
Delete branch "%!s()"
Deleting a branch is permanent. Although the deleted branch may continue to exist for a short time before it actually gets removed, it CANNOT be undone in most cases. Continue?
Depends on P4-1. Requires the Windows runner (#19).
Goal
Implement
vfs.PlaceholderFSon Windows using the Cloud Files API (CfAPI) — the samemechanism OneDrive uses. Windows 10 1709 and later.
Why Windows first
Of the three platforms, Windows has the most mature and best-documented placeholder API, and
the largest share of the enterprise desktops this feature is aimed at. Getting the abstraction
right against a real OS here makes P4-3 and P4-4 easier.
What CfAPI gives you
CfRegisterSyncRoot/CfConnectSyncRoot— declare the folder as cloud-backed.CfCreatePlaceholders— create metadata-only entries.CF_CALLBACK_TYPE_FETCH_DATAfires when something reads aplaceholder. You stream the content back with
CfExecute.CfSetPinState— the OS's own pin concept; map it ontovfs.PinStaterather than inventinga parallel one, so "Always keep on this device" in Explorer does the expected thing.
Go and cgo — the constraint that bites
The repo is
CGO_ENABLED=0everywhere. CfAPI is a C API.Resolve this before writing code, and record the decision in the issue:
golang.org/x/sys/windowswithsyscall.NewLazyDLL/NewProcto callcldapi.dlldirectly — keeps
CGO_ENABLED=0. Preferred. The callback registration is the hard part;verify it is reachable this way before committing to it.
CGO_ENABLED=0rule and complicates cross-compilation. Only if the first genuinely cannotwork.
Whichever you choose, it must not leak past
internal/vfs. The engine never learns Windowsexists.
Traps
runtime.LockOSThreadwhere required and never block afetch callback on a slow network without reporting progress — Explorer will appear frozen.
CfReportProviderProgress, or large hydrations look like a hang.not wedge Explorer.
root idempotently.
Orphaned placeholders after uninstall are files the user can see and never open — which reads
exactly like data loss.
Steps
CreatePlaceholder,Hydrate,Dehydrate,SetPin,Pin.remote.Remoteranged GET.open one, confirm only that one hydrates.
git commit -s -m "feat(vfs): Windows Cloud Filter placeholder provider"Acceptance criteria
internal/syncis unchanged.