You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
fix(services): enqueue notify-deliver for the approval-queue staged-action and reminder badges (#10182)
A notification_deliveries row is only visible in the feed once notify-deliver
promotes it out of pending, and every other insert in the codebase pairs the insert
with an enqueue. The approval queue's two inserts did not: stageForApproval's
staged-action badge and sweepStaleApprovalQueue's #9032 reminder badge were both
created at pending with no notify-deliver job, so they sat invisible until the
stranded-delivery sweep rescued them 10+ minutes later (a rescue for a FAILED enqueue,
not the primary path) -- contradicting the staleness module's framing of the staging
badge as the notification the maintainer gets.
Enqueue one notify-deliver per freshly-created pending delivery at both sites, mirroring
evaluateAndEnqueueNotificationDeliveries' created + pending guard: a dedup hit or a
suppressed non-pending row enqueues nothing. Best-effort: a rejected send is caught,
warns approval_notification_enqueue_failed, and does not abort staging (still returns
true) or the sweep loop (still counts the reminder). Extend the notify-deliver
requestedBy union with agent-approval. The dedup keys, the insert helper,
deliverNotification, buildNotificationFeed, and the stranded sweep are unchanged.
Closes#10025
@@ -627,8 +628,21 @@ export async function sweepStaleApprovalQueue(env: Env, nowMs: number = Date.now
627
628
body: `${row.reason??"A staged action"} — accept to execute it, or reject to cancel. It expires after ${Math.round(APPROVAL_EXPIRY_MS/(24*60*60*1000))} days.`,
0 commit comments