fix(folder): make empty-trash deletion idempotent - #8934
SulimanAbdulrazzaq wants to merge 1 commit into
Conversation
There was a problem hiding this comment.
Sorry @SulimanAbdulrazzaq, your pull request is larger than the review limit of 150000 diff characters
Reviewer's GuideMakes empty-trash operations idempotent by treating missing backing collab data as a successful delete, and adds a small helper and tests to enforce this behavior in the folder manager trash deletion flow. Sequence diagram for idempotent empty-trash deletionsequenceDiagram
participant FolderManager
participant Folder
participant FolderOperationHandler
FolderManager->>Folder: get_my_trash_info()
loop each TrashInfo.id
FolderManager->>FolderManager: delete_trash(id)
FolderManager->>Folder: delete_trash_view_ids(id)
FolderManager->>Folder: delete_views(id)
FolderManager->>FolderOperationHandler: delete_view(view_uuid)
FolderOperationHandler-->>FolderManager: Result
FolderManager->>FolderManager: ignore_missing_view_error(Result)
alt [error.is_record_not_found()]
FolderManager-->>FolderManager: treat as Ok(())
else [other error]
FolderManager-->>FolderManager: propagate Err(error)
end
end
File-Level Changes
Assessment against linked issues
Possibly linked issues
Tips and commandsInteracting with Sourcery
Customizing Your ExperienceAccess your dashboard to:
Getting Help
|
4ef7148 to
855fab3
Compare
|
@LucasXu0 when you have a moment, could you take a look at this one? It fixes #8921: emptying the trash now treats an already-missing backing collab as deleted, so stale database-view trash entries can be removed, while other deletion errors still propagate. The CLA is signed and the branch merges cleanly; the CI runs on this head ended without running any jobs, so they may need a re-run. |
Feature Preview
N/A — bug fix.
Fixes #8921
Emptying the trash now treats an already-missing backing collab as a successful deletion. This removes stale database-view trash entries while still propagating other deletion errors.
PR Checklist
Validation
rustfmt --edition 2024 --check frontend/rust-lib/flowy-folder/src/manager.rspassed.cargo test -p flowy-folder --libcould not complete locally because Cargo could not fetch all git/crates.io dependencies within the available environment.Summary by Sourcery
Make empty-trash deletion idempotent by treating missing backing collab data as a successful delete.
Bug Fixes:
RecordNotFounderrors.Tests:
RecordNotFounderrors from view deletion are treated as success and that other error types are propagated.