1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
use PgPool;
/// Reads the current `locked_until` of the row whose `message_id` is `id` — the read half of the
/// lease-renewal probes (ADR 0043 §5): a real-time *eventually*/*never* assertion reads this
/// twice around a renewal tick rather than inferring renewal from whether the row is claimable,
/// since claimability also changes the instant a row completes (§43 review round 1, B2/B3).
///
/// Filters on `message_id`, not `id` (ADR 0044 §1): every call site holds the envelope's
/// `MessageId` (from `common::seed`'s returned envelopes or a captured publish), never the row's
/// own database-assigned surrogate id.
pub async
/// Moves the row whose `message_id` is `id`'s lease into the past — SQL time-travel for
/// lease-expiry tests, never a wall-clock sleep (§8.2). Moves **both** `locked_until` and
/// `available_at` (ADR 0040 §1: a claim now writes them to the same instant, so simulating "the
/// lease has lapsed" means moving both — leaving `available_at` at its claimed value would leave
/// the row invisible to the claim's own `available_at <= now()` boundary even though
/// `locked_until` has passed). Filters on `message_id`, see [`locked_until`].
pub async
/// Moves the `available_at` of the row whose `message_id` is `id` into the past — makes a
/// retry-delayed row due without waiting. Filters on `message_id`, see [`locked_until`].
pub async
/// Ages an already-committed inbox row's `updated_at` by `age` (a Postgres interval literal, e.g.
/// `"30 days"`) — SQL time-travel for retention-ageing and in-flight-row scenarios (ADR 0043 §5),
/// promoted from the identical inline `UPDATE` three inbox scenario files each wrote by hand.
/// Never used to move `completed_at`/`dead_at` themselves — those are set at seed time by the
/// caller's own `INSERT` when the seeded state (not the ageing) is what a test is proving.
pub async