fix(macos): guard against empty ocId items crashing FileProvider - #10704
Draft
camilasan wants to merge 2 commits into
Draft
fix(macos): guard against empty ocId items crashing FileProvider#10704camilasan wants to merge 2 commits into
camilasan wants to merge 2 commits into
Conversation
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>
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>
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.
Summary
Fix for #10701.
Item.itemIdentifiercomes 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__. SinceocIdis 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:
addItemMetadatarefuses to persist an emptyocId(source).Item.storedItemreturns nil for an empty identifier (collision path).toFileProviderItemsskips emptyocIdrows (enumeration).ocIdrows straight to Realm, and purge any left by an earlier buildocIdfrom the server instead of returning an item with an empty identifierDeletion protection: change reporting skips empty identifiers before
didDeleteItemsTODO
Checklist
AI (if applicable)