Skip to content

fix(macos): guard against empty ocId items crashing FileProvider - #10704

Draft
camilasan wants to merge 2 commits into
masterfrom
bugfix/10701/crash
Draft

fix(macos): guard against empty ocId items crashing FileProvider#10704
camilasan wants to merge 2 commits into
masterfrom
bugfix/10701/crash

Conversation

@camilasan

@camilasan camilasan commented Aug 31, 2026

Copy link
Copy Markdown
Member

Summary

Fix for #10701.

Item.itemIdentifier comes straight from metadata.ocId. A row with an empty ocId becomes an item with an empty identifier, and the framework aborts with __FILEPROVIDER_BAD_ITEM_MISSING_IDENTIFIER__. Since ocId is the Realm primary key, one bad row persists and re crashes both the 405 collision path and change enumeration, in a loop that only a database wipe cleared.

Resolves

Three guards so a bad row never reaches the framework:

  • addItemMetadata refuses to persist an empty ocId (source).
  • Item.storedItem returns nil for an empty identifier (collision path).
  • toFileProviderItems skips empty ocId rows (enumeration).
  • depth 1 folder reads no longer write empty ocId rows straight to Realm, and purge any left by an earlier build
  • dolder and file creation reject an empty ocId from the server instead of returning an item with an empty identifier
    Deletion protection: change reporting skips empty identifiers before didDeleteItems

TODO

Checklist

AI (if applicable)

Fix for #10701.

Empty ocId metadata rows became File Provider items with an empty identifier,
aborting the framework with __FILEPROVIDER_BAD_ITEM_MISSING_IDENTIFIER__
on both the 405 collision path and change enumeration, in a self sustaining crash loop.

Reject empty ocId on write, return nil when resolving an empty identifier,
and skip empty ocId rows during enumeration.

Assisted-by: Claude Code:claude-opus-4-8
Signed-off-by: Camila Ayres <camila.ayres@nextcloud.com>
@camilasan camilasan added this to the 34.0.4 milestone Aug 31, 2026
@camilasan

Copy link
Copy Markdown
Member Author

/backport to stable-34.0

Skip empty ocId rows while enumerating a folder, and clear any left from before.
Also skip empty identifiers in the deletion batch.

Assisted-by: Claude Code:claude-opus-4-8
Signed-off-by: Camila Ayres <hello@camilasan.com>
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Projects

None yet

Development

Successfully merging this pull request may close these issues.

1 participant