Commit 6d881e7
fix(webapp): skip buffer-side delayUntil guard on reschedule when entry is materialised
The reschedule route enforces a buffer-side equivalent of the
PG service's `taskRun.status !== "DELAYED"` precondition by reading
the buffered snapshot's `delayUntil` and 422'ing when absent. Post
materialisation the buffer entry hangs around for a 30s grace TTL
with `materialised: true`, and `findRunByIdWithMollifierFallback`
returns the stale snapshot regardless. If a run was originally
buffered without `delayUntil` but subsequently became DELAYED on
the PG side (a prior reschedule routed to PG, the engine set the
delay through another path, etc.), the guard 422'd a legitimately
DELAYED PG row.
Switch to a direct `buffer.getEntry()` read and only apply the
guard when `entry.materialised !== true`. Post-materialisation we
let `mutateWithFallback` route to PG, which runs its own canonical
DELAYED check on the actual current state. Also adds env/org
scoping at the read — matches the rest of the mutations layer and
prevents a cross-environment buffer entry leak from the guard's
read.
Devin follow-up on PR #3756.
Co-Authored-By: Claude Opus 4.7 (1M context) <noreply@anthropic.com>1 parent 68b1e30 commit 6d881e7
1 file changed
Lines changed: 29 additions & 14 deletions
Lines changed: 29 additions & 14 deletions
| Original file line number | Diff line number | Diff line change | |
|---|---|---|---|
| |||
10 | 10 | | |
11 | 11 | | |
12 | 12 | | |
13 | | - | |
| 13 | + | |
14 | 14 | | |
15 | 15 | | |
16 | 16 | | |
| |||
58 | 58 | | |
59 | 59 | | |
60 | 60 | | |
61 | | - | |
62 | | - | |
63 | | - | |
64 | | - | |
65 | | - | |
66 | | - | |
67 | | - | |
68 | | - | |
69 | | - | |
70 | | - | |
71 | | - | |
72 | | - | |
73 | | - | |
| 61 | + | |
| 62 | + | |
| 63 | + | |
| 64 | + | |
| 65 | + | |
| 66 | + | |
| 67 | + | |
| 68 | + | |
| 69 | + | |
| 70 | + | |
| 71 | + | |
| 72 | + | |
| 73 | + | |
| 74 | + | |
| 75 | + | |
| 76 | + | |
| 77 | + | |
| 78 | + | |
| 79 | + | |
| 80 | + | |
| 81 | + | |
| 82 | + | |
| 83 | + | |
| 84 | + | |
| 85 | + | |
| 86 | + | |
| 87 | + | |
| 88 | + | |
74 | 89 | | |
75 | 90 | | |
76 | 91 | | |
| |||
0 commit comments