Repository navigation
feat(ui): (optional) Protect starred media from accidental deletion - #9458
FloeHetling wants to merge 2 commits into
Conversation
|
@Pfannkuchensack |
|
on it, will provide resolve till the weekend |
a1ad648 to
a76cd7a
Compare
a76cd7a to
c239b02
Compare
|
@Pfannkuchensack on par with |
c239b02 to
a05dd0d
Compare
|
V7 retarget is planned for tomorrow |
a05dd0d to
3a5f39e
Compare
joshistoast
left a comment
There was a problem hiding this comment.
concurrent star updates can bypass deletion protection, and partially successful deletions can clear project references to protected media.
|
|
||
| if (result.succeeded.length === 0) { | ||
| // Nothing went away (every item was refused or kept), so the widget values cleared up front come back too. | ||
| restoreGalleryItemRemoval(galleryWidgetSnapshot); |
There was a problem hiding this comment.
[P2] Restore protected widget references on partial success
With stale cached star information, a mixed request can delete one item while the backend protects another. Optimistic removal has already cleared both items from Gallery state and Upscale/Video inputs across projects. The protected item’s query cache is restored, but widget references are restored only when nothing succeeded. Restore protected survivors’ references during partial success while keeping deleted items removed.
Add a "Protect starred media" setting (off by default). While it is on, deleting images or videos skips starred ones, and deleting a board with its media moves starred items to Uncategorized instead. Add `delete_starred` to the image, video and board delete endpoints and report skipped items in `starred_skipped`; clients that omit it keep the old behavior.
Protected deletes now refuse starred rows in the same transaction that removes the records, so a star set while files were being staged keeps its record and its files are restored. Applies to single, batch and board deletes of images and videos. Starred-only deletes without confirmation now say nothing was deleted; the board dialog notice names the button it applies to and handles loading and errors.
3a5f39e to
7431ec3
Compare
yup, found, examined and addressed that in my latest update, thank you! |
Summary
Related Issues / Discussions
This is a complete re-work of #8406, done from scratch relying on latest unified gallery, video deletion and multi-user board changes.
The feature was carefully rebased/reworked onto V7 webv2 stack.
QA Instructions
Careful. This test implies some of the images and videos can or will be eventually lost. For safety of your artwork, consider using testing environment
Merge Plan
No special merge plan should be needed. The feature was completely re-done from scratch on top of latest
maininstead of reusing the old implementation. Generated OpenAPI schema and frontend API types are included in the PR.Checklist
What's Newcopy (if doing a release after this PR)