summaryrefslogtreecommitdiffstats
path: root/src/pkgver/mod.rs
diff options
context:
space:
mode:
authoraur-build <aur-build@localhost>2026-11-18 15:48:02 +0000
committeraur-build <aur-build@localhost>2026-11-18 15:48:02 +0000
commit062efa6583b7fea292a4f485659661d266461611 (patch)
treea9a54bba0dad9fbd07115f5bfad8db948ab6b30e /src/pkgver/mod.rs
parent753e05a4f588d3e8a3ea0b88b2e03d74f9f00be8 (diff)
downloadaur-build-062efa6583b7fea292a4f485659661d266461611.tar.gz
aur-build-062efa6583b7fea292a4f485659661d266461611.zip
review: a database failure is never reported to a reviewer as a stale review
`approve()` returned `Result<Approval, Stale>` and then collapsed every inner failure into `Stale::NotPending { state: e.to_string() }`, so a SQLite error reached the human as "review is no longer pending (state: sqlite: …)". That is the one message that tells a reviewer to look again when the truth is that the write failed — and the transaction had already rolled back, so their review was still pending and nothing on screen explained why. `bulk()` bent the same variant to mean "high risk", "unknown decision" and "the database failed", and handed back a fabricated `Approval { id: 0 }` for a rejection that recorded no approval at all. `approve()` now returns `Result<Approval, ApproveError>` with two families: `Stale(Stale)` — what is stored is not what was displayed, look again — and `System(Error)` — the write failed, nothing about the review is at fault. The UI answers the first with the 409 and fresh diff it already gave, and the second with a 500 that names the cause; the CLI exits 2 for the first and propagates the second as an error. `bulk()` got its own vocabulary — `BulkOutcome::{Approved, Rejected, Refused(BulkRefusal)}` with `HighRiskUnconfirmed`, `UnknownDecision`, `NotFound`, `Stale` and `System` — and returns no approval row for a rejection, because there is none. The invented `id: 0` is gone. The web handler had its own copy of the bulk loop; it now calls `approve::bulk`, so the page and the library cannot disagree about what §7.4 says. Three tests: a dropped `audit` table mid-transaction must surface as `System` and must leave the review pending and the approval table empty; bulk refusals must name the risk, the unknown decision, and (after a real approval) the genuine staleness as three different things; a bulk rejection must record a `rejected` row and hand back nothing.
Diffstat (limited to 'src/pkgver/mod.rs')
0 files changed, 0 insertions, 0 deletions