fix(server): trash and photo-delete API answers, body limit and audit
- frames/delete carries its own request body limit (about 4.8 MB), so the documented 100,000 ids fit; the server's 1 MiB stopped at about 26,900. - Restore tells a damaged or foreign sidecar of the target sequence (409 sidecar_mismatch) from an entry whose files no longer match its record (422 trash_mismatch, now a TrashMismatchException); frames/delete answers sidecar_mismatch instead of 500, and 404 when the sequence left the index between plan and delete, also on the re-plan. - With the archive offline, the trash list and the empty plan answer 503 archive_offline instead of an empty trash; a read-only archive still lists and plans but cannot be emptied. - The empty request is audited as trash_empty_requested: the job checks the plan again and may erase nothing, so the entry no longer claims an erase that has not happened. - API tests for these paths, a named subset emptied, sequence-entry restore and sequence_in_library, photos restored into a new sequence, viewer 403 on bulk routes and admin deletes of another user's photos. Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com> (cherry picked from commit fa35831d55c44746f7f76e0cff262ed6aecf8e72)
This commit is contained in:
1 parent
316c182b19
commit
66c3662954
9 files changed
+350
-24
No files matched your search
@@ -266,7 +266,7 @@ public abstract class FrameTrashTests(TestContext context) : DatabaseTest(contex
|
||||
Assert.FileExists(damaged);
|
||||
|
||||
// Nothing left that matches: the entry stays as it is.
|
||||
await Assert.ThrowsAsync<InvalidDataException>(() => fx.Service.RestoreEntryAsync(fx.Archive.Id, deleted.Entry.Name, null, fx.Ct));
|
||||
await Assert.ThrowsAsync<TrashMismatchException>(() => fx.Service.RestoreEntryAsync(fx.Archive.Id, deleted.Entry.Name, null, fx.Ct));
|
||||
Assert.FileExists(damaged);
|
||||
}
|
||||
|
||||
|
||||
Reference in new issue
Block a user