Skip to content

fix(windows): recover Cloud Files placeholder collisions and corrupt metadata #315

Description

@veryCrunchy

Problem

Windows Cloud Files placeholder population can race with an Explorer-triggered on-demand population callback after the provider connects. Both paths can attempt to create the same entry, and Windows returns HRESULT 0x800700b7 (ERROR_ALREADY_EXISTS).

The first collision fix still treated an unreadable Cloud Files entry as absent because Java Files.exists() returns false when Windows reports corrupt placeholder metadata. The provider then retried the same creation, received ERROR_ALREADY_EXISTS again, exhausted its retry bound, and left filesync unavailable.

An ordinary local file or folder can also exist in the damaged root. Recovery must preserve all local data rather than deleting or overwriting the root.

Scope

  • Distinguish missing, ordinary local, valid placeholder, corrupt, and otherwise unreadable entries from native Windows evidence.
  • Recognize ERROR_CLOUD_FILE_METADATA_CORRUPT and CF_PLACEHOLDER_STATE_INVALID.
  • Preserve the complete damaged root without replacement or deletion.
  • Rebuild the Cloud Files provider once at its canonical location.
  • Surface the preserved recovery location and mark it as needing attention.
  • Record pseudonymized native inspection and recovery evidence in support bundles.
  • Keep unrelated native errors fail-closed.

Acceptance criteria

  • A placeholder collision followed by corrupt metadata does not leave filesync permanently unavailable.
  • The original root is moved only after the provider is disconnected and unregistered.
  • Existing local files, hydrated data, and ambiguous entries are not deleted, overwritten, converted, or dehydrated.
  • Recovery never replaces an existing recovery root.
  • If preserving the root fails, the original path and bytes remain unchanged.
  • The provider performs at most one clean-root recovery attempt per activation.
  • The user can find the preserved root after recovery.
  • Focused and full desktop tests, Windows packaging, and repository hygiene pass.
  • A Windows nightly is verified against the reported damaged-root scenario before merge.

Relationships

Parent

Activity

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Metadata

Metadata

Assignees

Labels

area:files-syncFiles, offline storage, transfer, and synchronizationarea:platformAndroid, desktop, iOS, Windows, macOS, and Linux platform workin-progressImplementation is currently activeplatform:desktopDesktop-specific implementation or validationpriority:P0Required for a trustworthy mobile replacement or prevents data losstype:bugtype:reliabilityCorrectness, crash prevention, recovery, and data safety

Type

No type

Projects

Relationships

None yet

Development

No branches or pull requests

Issue actions