-
Notifications
You must be signed in to change notification settings - Fork 1
fix: Trash enumerates only locally trashed items. #140
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
Conversation
i2h3
commented
Jan 14, 2026
- Introduced new schema property wasTrashedLocally on SendableItemMetadata.
- Added corresponding schema version and migration.
- Extended related data models accordingly.
- Updated Enumerator to no longer enumerate remote trash items based on wasTrashedLocally.
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Pull request overview
This pull request adds a new wasTrashedLocally boolean property to track whether items were trashed on the local device versus on the server or another client. The intent is to exclude remote trash items from trash container enumeration, showing only locally trashed items to users.
Changes:
- Added
wasTrashedLocallyproperty to ItemMetadata protocol, RealmItemMetadata, and SendableItemMetadata with schema migration - Updated extension methods to accept and pass through the
wasTrashedLocallyparameter - Modified Item+Trash.swift to set
wasTrashedLocally: truewhen trashing items locally andwasTrashedLocally: falsewhen restoring items - Changed Enumerator+Trash.swift to skip enumerating remote trash items
Reviewed changes
Copilot reviewed 14 out of 14 changed files in this pull request and generated 6 comments.
Show a summary per file
| File | Description |
|---|---|
| Sources/NextcloudFileProviderKit/Metadata/ItemMetadata.swift | Added wasTrashedLocally property to protocol |
| Sources/NextcloudFileProviderKit/Metadata/RealmItemMetadata.swift | Added persisted wasTrashedLocally property with default value false |
| Sources/NextcloudFileProviderKit/Metadata/SendableItemMetadata.swift | Added wasTrashedLocally property with documentation and updated initializers |
| Sources/NextcloudFileProviderKit/Database/SchemaVersion.swift | Added new schema version for wasTrashedLocally |
| Sources/NextcloudFileProviderKit/Database/FilesDatabaseManager.swift | Added migration logic, updated schema version, fixed logging inconsistency |
| Sources/NextcloudFileProviderKit/Extensions/NKTrash+Extensions.swift | Added wasTrashedLocally parameter to toItemMetadata with documentation |
| Sources/NextcloudFileProviderKit/Extensions/NKFile+Extensions.swift | Added wasTrashedLocally parameter to toItemMetadata |
| Sources/NextcloudFileProviderKit/Item/Item.swift | Updated placeholder item creation to include wasTrashedLocally: false |
| Sources/NextcloudFileProviderKit/Item/Item+Trash.swift | Set wasTrashedLocally: true for locally trashed items, false for restored items, improved logging |
| Sources/NextcloudFileProviderKit/Item/Item+Create.swift | Updated item creation to include wasTrashedLocally: false |
| Sources/NextcloudFileProviderKit/Item/Item+LockFile.swift | Updated lock file creation to include wasTrashedLocally: false |
| Sources/NextcloudFileProviderKit/Item/Item+Ignored.swift | Updated ignored file creation to include wasTrashedLocally: false |
| Sources/NextcloudFileProviderKit/Item/Item+Modify.swift | Formatting improvements and code cleanup |
| Sources/NextcloudFileProviderKit/Enumeration/Enumerator+Trash.swift | Modified to skip enumerating remote trash items, added documentation and debug logging |
💡 Add Copilot custom instructions for smarter, more guided reviews. Learn how to get started.
Sources/NextcloudFileProviderKit/Enumeration/Enumerator+Trash.swift
Outdated
Show resolved
Hide resolved
Sources/NextcloudFileProviderKit/Enumeration/Enumerator+Trash.swift
Outdated
Show resolved
Hide resolved
Sources/NextcloudFileProviderKit/Enumeration/Enumerator+Trash.swift
Outdated
Show resolved
Hide resolved
fd6a502 to
be059e4
Compare
- Introduced new schema property wasTrashedLocally on SendableItemMetadata. - Added corresponding schema version and migration. - Extended related data models accordingly. - Updated Enumerator to no longer enumerate remote trash items based on wasTrashedLocally. Signed-off-by: Iva Horn <iva.horn@nextcloud.com>