Archive and unarchive answer 500 for expected refusals instead of 404/409
Maintainers usually reply within 1 day
Nobody has claimed this yet.
Assessment
- Difficulty
- 3/5
- Estimated time
- 1-2 days
- Newbie friendliness
- 66/100
- Issue type
- Bug
- Clarity
- Clearly specified
- Activity status
- Active
- Tech stack
- rust
- Domain
- backend-api-design, testing
Research direction
Start with concert-tracker/src/web/handlers.rs, reading concert_command_error, archive_endpoint_error, and the archive and unarchive handlers. Then inspect the named handler tests and hurl/archive_lifecycle.hurl; check the documented HTMX behavior for refused requests. Done means refusals return 404 or 409, operational failures remain 500, tests cover the refusals and HTMX outcome, and refusals do not log at ERROR.
Written by the indexing model from the issue text.
Description
Summary
Archive and unarchive answer 500 for every expected refusal, while every other
commanded endpoint answers the typed status its rejection names (404, 409, 422).
A user clicking Archive with no archive location configured — or Unarchive on a
concert that is not archived — is reported as a server fault: the response is
500, AppError::Internal logs it at ERROR, and the log line reads
archive location is not configured where a client error belongs.
Found while implementing #167
(PR #195), where the
interface started returning typed rejections for both routes. The mapping was
deliberately left alone there and recorded as a non-change; this issue is the
follow-up.
Where it comes from
concert-tracker/src/web/handlers.rs has two rejection mappings:
concert_command_error(line ~679) —NotFound→ 404,Conflict→ 409,
a missing split source → 422,SourceNotRedundant→ 409. Used by the other
commands.archive_endpoint_error(line ~1751) — everyCommandRejection→
AppError::Internal→ 500. Used byarchiveandunarchiveonly.
The refusals that reach it are ordinary domain outcomes, not faults:
| Route | Refusal |
|---|---|
POST /concerts/{id}/archive |
no archive location configured (Conflict) |
POST /concerts/{id}/archive |
no such concert (NotFound) |
POST /concerts/{id}/unarchive |
not archived, no album, or an archive in flight (Conflict) |
POST /concerts/{id}/unarchive |
no such concert (NotFound) |
ConcertCommandError::Operational genuinely is a 500; only the Rejected arm is
wrong.
Why it matters
- The interface rejects before a client is offered an action, so a refusal here
means a stale page or a configuration gap, not an outage. Reporting it as a 5xx
makes real failures harder to see. AppError::Internallogs every such refusal atERROR.- The planned JSON adapter inherits the inconsistency: the same refusal is a 409
forrequest_downloadand a 500 forrequest_archive.
What pins today's behavior (must be updated with the fix)
hurl/archive_lifecycle.hurlexpectsHTTP 500in three places:
archive_without_a_configured_location_is_the_endpoints_own_500(~line 40),
unarchiving_what_is_not_archived_keeps_the_endpoints_own_500(~line 139),
a_missing_concert_is_also_this_endpoints_500(~line 165).concert-tracker/src/web/handlers.rs:
archiving_what_cannot_be_archived_is_this_endpoints_own_500and
unarchiving_what_is_not_archived_is_this_endpoints_own_500.docs/change/2026-11-12-archive-and-unarchive-workflows.md("Deliberate
non-changes"), plus any route documentation that records the 500s.
Acceptance criteria
-
archiveandunarchivemapRejectedthrough the same mapping the other
commands use, so a refusal answers the status itsCommandRejectionnames —
404 for an absent concert, 409 for a state conflict. -
Operationalstill answers 500. -
archive_endpoint_erroris gone, or reduced to its operational arm, so a
third copy of the mapping cannot appear. - The three hurl expectations and the two handler tests assert the new
statuses, and the hurl file still covers every refusal it covers now. - HTMX behavior is verified, not assumed: htmx does not swap on a 4xx by
default, so confirm what the user sees for a refused archive and unarchive
now that the status changed (error toast, no-op, or anhx-target-error
swap) and record it. - Neither route writes an
ERRORlog line for a refusal.
- Dominant language
- Rust
- Stars
- 0
- Forks
- 0
- Avg merge
- 2h
- Merged PRs (30d)
- 14
Getting set up
- Ships a Dockerfile or Docker Compose file
- No pull request template
- Read the contributing guide
First steps
- Read the whole issue, then the project's contributing guide.
- Comment on the issue to say you are picking it up — it saves two people doing the same work.
- Fork the repository and make your change on a branch.
- Open a pull request that references the issue number.
More from gregwebs/tiny-desk-splitter
-
bug
Difficulty 4/5 3-5 days Newbie friendliness 55/100
gregwebs/tiny-desk-splitter#197 ·
Maintainers usually reply within 1 day
-
test test-flakiness
Difficulty 3/5 1-2 days Newbie friendliness 56/100
gregwebs/tiny-desk-splitter#190 ·
Maintainers usually reply within 1 day
-
bug
Difficulty 3/5 1-2 days Newbie friendliness 75/100
gregwebs/tiny-desk-splitter#189 ·
Maintainers usually reply within 1 day
-
bug test-flakiness
Difficulty 3/5 1-2 days Newbie friendliness 75/100
gregwebs/tiny-desk-splitter#187 ·
Maintainers usually reply within 1 day
-
bug test-flakiness
Difficulty 4/5 3-5 days Newbie friendliness 38/100
gregwebs/tiny-desk-splitter#186 ·
Maintainers usually reply within 1 day
All issues in gregwebs/tiny-desk-splitter
Similar issues
-
[Bug]: LANGSMITH_SAMPLING_RATE ignores fractional values (isdigit check), traces 100% of requestsOpen
Difficulty 2/5 1-3 hours Newbie friendliness 84/100
Maintainers usually reply within 1 day
-
Difficulty 2/5 1-3 hours Newbie friendliness 78/100
LadybirdBrowser/ladybird#15164 ·
Maintainers usually reply within 1 day
-
CLI serve help omits doc.replaceSmartObjectPossibly taken @MMexicann claimed this today. Open
Difficulty 2/5 1-3 hours Newbie friendliness 72/100
storytold/photocraft#15831 · 1 comment ·
Maintainers usually reply within 1 day
-
Difficulty 1/5 1-3 hours Newbie friendliness 78/100
Maintainers usually reply within 1 day
-
area:ci bug
Difficulty 2/5 1-3 hours Newbie friendliness 72/100
Maintainers usually reply within 1 day