Files
shelfmark/tests/core
splitsec2andCaliBrain 520b6b16d0 fix(activity): Clear Completed leaves out an item that is no longer finished instead of failing the batch (#1508)
Clear Completed can fail outright with "Only terminal requests can be
dismissed". `dismiss-many` answers 409 and dismisses nothing when any
one request or download in the batch is not terminal. The list a user
clears from can be older than the server, so a request that was reopened
or retried since, or a download that started again, takes the whole
batch down with it. The earlier fix for pending requests (#1438) filters
on the client, which only helps when the list is current.

`dismiss-many` now skips such an item and carries on with the rest. The
response adds `skipped_item_keys` when something was left out, and
`count` is what was actually dismissed. A single `dismiss` of a
non-terminal item still answers 409.

I hit it with a request whose download had completed while the request
itself was still pending, but any reopen between the list and the click
does it.

This touches the same handler as #1507, so whichever lands second needs
a small rebase.

Tests: a batch with a finished and a reopened request dismisses the
finished one and reports the other, and a batch with a finished and a
running download does the same. Ruff, basedpyright and the backend suite
pass (3933 passed, e2e excluded).

Co-authored-by: CaliBrain <calibrain@l4n.xyz>
2026-10-21 01:39:14 -04:00
..
2026-03-07 10:30:47 +00:00
2026-10-20 01:55:49 -04:00