fix(folder): make empty-trash deletion idempotent - #8934
Open
SulimanAbdulrazzaq wants to merge 1 commit into
Open
fix(folder): make empty-trash deletion idempotent#8934SulimanAbdulrazzaq wants to merge 1 commit into
SulimanAbdulrazzaq wants to merge 1 commit into
Conversation
|
|
Contributor
There was a problem hiding this comment.
Sorry @SulimanAbdulrazzaq, your pull request is larger than the review limit of 150000 diff characters
Contributor
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
|
SulimanAbdulrazzaq
force-pushed
the
fix/8921-idempotent-trash-delete
branch
from
August 9, 2026 12:41
4ef7148 to
855fab3
Compare
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.
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.