Skip to content

Guard against empty ocId crashing File Provider - #10704

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

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)

@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

@Rello Rello added os: 🍎 macOS Apple macOS, formerly also known as OS X feature: 📁 file provider macOS File Provider Extension, more general also known as virtual file system. labels Sep 4, 2026
@camilasan camilasan modified the milestones: 34.0.4, 35.0.0 Sep 14, 2026
camilasan and others added 2 commits September 14, 2026 16:39
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>
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>
@i2h3
i2h3 force-pushed the bugfix/10701/crash branch from d5ac724 to 4823100 Compare September 14, 2026 14:39
@i2h3 i2h3 self-assigned this Sep 14, 2026
@github-project-automation github-project-automation Bot moved this to 🧭 Planning evaluation (don't pick) in 💻 Desktop Clients team Sep 14, 2026
@i2h3 i2h3 moved this from 🧭 Planning evaluation (don't pick) to 🏗️ In progress in 💻 Desktop Clients team Sep 14, 2026
@i2h3 i2h3 changed the title fix(macos): guard against empty ocId items crashing FileProvider Guard against empty ocId crashing File Provider Sep 14, 2026
@i2h3 i2h3 removed their assignment Sep 14, 2026
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

backport-request feature: 📁 file provider macOS File Provider Extension, more general also known as virtual file system. os: 🍎 macOS Apple macOS, formerly also known as OS X

Projects

Status: 🏗️ In progress

Development

Successfully merging this pull request may close these issues.

3 participants