Commit 741b561
committed
fix(admin/sqs): map leader-churn errors to 503; add tests; SPA polish
Three findings from Claude review on PR #670:
1. (P1) translateAdminQueuesError did not catch leader-churn errors.
AdminDeleteQueue passes the upfront isVerifiedSQSLeader check,
then dispatches deleteQueueWithRetry which can hit a kv coordinator
that just lost leadership. The resulting kv.ErrLeaderNotFound /
adapter.ErrNotLeader / wrapped "not leader" suffixes were not in
the translator's switch — they fell to default and the admin
handler rendered a generic 500 instead of the spec'd 503 +
Retry-After: 1. Added the `case isLeaderChurnError(err)` arm
mirroring translateAdminTablesError's identical fix from PR #634.
2. (P2) No tests for translateAdminQueuesError. Mirrored the three
Dynamo equivalents in main_admin_test.go:
- TestTranslateAdminQueuesError_LeaderChurn covers every kv
sentinel + canonical wrapped-suffix variant.
- TestTranslateAdminQueuesError_LeaderPhraseInMiddleOfMessage
pins the HasSuffix matcher behaviour against false positives
on user-supplied error messages mid-string.
- TestTranslateAdminQueuesError_UnrelatedErrorPassesThrough
confirms the detector does not swallow innocent "leader"
mentions outside the canonical phrase set.
3. (Low / polish) SqsList.tsx subtitle leaked the Go file path
"adapter/sqs_admin.go" and the internal milestone name
"Phase 3.A" to end users — DynamoList / S3List don't do this.
Replaced with operator-facing prose describing what the page does.
Verified:
- go test -run TestTranslateAdminQueuesError . — passes
- go build ./... clean
- go test -race ./internal/admin/... + go test -race -run TestSQS ./adapter/ — pass
- golangci-lint run ./adapter/... ./internal/admin/... ./... — 0 issues
- cd web/admin && npm run lint (tsc --strict) clean1 parent 3a8a1d7 commit 741b561
3 files changed
Lines changed: 76 additions & 4 deletions
| Original file line number | Diff line number | Diff line change | |
|---|---|---|---|
| |||
211 | 211 | | |
212 | 212 | | |
213 | 213 | | |
| 214 | + | |
| 215 | + | |
| 216 | + | |
| 217 | + | |
| 218 | + | |
| 219 | + | |
| 220 | + | |
| 221 | + | |
| 222 | + | |
| 223 | + | |
| 224 | + | |
| 225 | + | |
| 226 | + | |
214 | 227 | | |
215 | | - | |
| 228 | + | |
216 | 229 | | |
217 | 230 | | |
218 | 231 | | |
| |||
| Original file line number | Diff line number | Diff line change | |
|---|---|---|---|
| |||
426 | 426 | | |
427 | 427 | | |
428 | 428 | | |
| 429 | + | |
| 430 | + | |
| 431 | + | |
| 432 | + | |
| 433 | + | |
| 434 | + | |
| 435 | + | |
| 436 | + | |
| 437 | + | |
| 438 | + | |
| 439 | + | |
| 440 | + | |
| 441 | + | |
| 442 | + | |
| 443 | + | |
| 444 | + | |
| 445 | + | |
| 446 | + | |
| 447 | + | |
| 448 | + | |
| 449 | + | |
| 450 | + | |
| 451 | + | |
| 452 | + | |
| 453 | + | |
| 454 | + | |
| 455 | + | |
| 456 | + | |
| 457 | + | |
| 458 | + | |
| 459 | + | |
| 460 | + | |
| 461 | + | |
| 462 | + | |
| 463 | + | |
| 464 | + | |
| 465 | + | |
| 466 | + | |
| 467 | + | |
| 468 | + | |
| 469 | + | |
| 470 | + | |
| 471 | + | |
| 472 | + | |
| 473 | + | |
| 474 | + | |
| 475 | + | |
| 476 | + | |
| 477 | + | |
| 478 | + | |
| 479 | + | |
| 480 | + | |
| 481 | + | |
| 482 | + | |
| 483 | + | |
| 484 | + | |
| 485 | + | |
| 486 | + | |
| 487 | + | |
| 488 | + | |
| Original file line number | Diff line number | Diff line change | |
|---|---|---|---|
| |||
11 | 11 | | |
12 | 12 | | |
13 | 13 | | |
14 | | - | |
15 | | - | |
16 | | - | |
| 14 | + | |
| 15 | + | |
17 | 16 | | |
18 | 17 | | |
19 | 18 | | |
| |||
0 commit comments