Files
shelfmark/tests/core
splitsec2 df07ed3e6f fix(auto-download): leave a failed request alone when no source can search it (#1693)
Fixes #1678.

The retry after the cooldown (**Retry failed downloads after (days)**)
reopened a failed request owned by an admin, or any request on an
install without login, even when no release source was usable for its
content type. Reopening clears the release and delivery state, and with
no source the auto-download pass never searches the request, so it sat
pending with nothing to act on it. A regular user's request has only
been reopened when the pass could fulfil it since #1676.

`OwnerPolicy.may_fulfil` returned True for those owners before looking
at sources. It now asks `download_sources` for every owner. That already
lets an exempt owner use every configured source, so an admin's request
is reopened exactly as before whenever a source exists, and is left as
it is when none does.

Tests: a request with no usable source is left alone for an admin-owned
request and on an install without login (both fail on main), and an
admin-owned request with a source is still reopened.
`TestRetryAfterCooldown` now configures a source, since every case there
expects one to search. Full Python suite, ruff and basedpyright pass.


<!-- This is an auto-generated comment: release notes by coderabbit.ai
-->

<!-- coderabbit-ai-generated:v1 -->

## Summary by CodeRabbit

* **Bug Fixes**
* Automatic download requests are reopened only when an available source
supports the requested content type. This applies to requests owned by
administrators and requests made without logging in, preventing requests
from being marked as fulfillable when no usable source is available.
Requests with a compatible source can still be reopened after a cooldown
or when a stalled download has settled.

<!-- end of auto-generated comment: release notes by coderabbit.ai -->
2026-11-13 16:55:16 -06:00
..
2026-10-21 02:05:05 -04:00
2026-03-07 10:30:47 +00:00