Repository navigation
fix(workflows): keep queue and priority across email queue retries - #127102
Conversation
A rescheduled email dropped its queue metadata, so the run returned to the hogflow queue at the email class priority instead of its own. Carry the metadata through SES throttles, workflow pacing, team caps and consecutive inline sends. Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
A push notification that fails transiently while its run is on the email queue now keeps the origin queue and priority that the email routing stashed. The run returns to its origin queue at its origin priority when it leaves the email queue. The retry waits at its own message category's email queue priority instead of its retry count. Each push action still starts its own retry budget. Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
Extract getEmailQueuePriority so the inline email send and the push retry share one class-to-priority lookup. Type the push provider fetch mock and reset it before each test, so a CI retry of a failed attempt does not start with leftover queued responses. Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
|
😎 Merged successfully - details. |
🤖 CI report✅ Trunk lane — non-backend laneThis PR is assigned to the non-backend lane. It does not run backend Python tests and may merge in parallel with PRs in other lanes. ✅ Duplication (Python) — cleanNew Python code duplication introduced by this branch. Fails at 70+ tokens in app code, or 150+ tokens when both copies live in test files. Advisory while the gate proves itself: extract a shared helper instead of copying. ✅ Duplication (TypeScript) — cleanNew TypeScript code duplication introduced by this branch. Fails at 70+ tokens in app code, or 150+ tokens when both copies live in test files. Advisory while the gate proves itself: extract a shared helper instead of copying. |
There was a problem hiding this comment.
PostHog Review · Standard · reviewed 29d303f: 1 Must fix.
This is the only automatic review while this pull request is a draft. Comment @posthog review to review new changes sooner. Otherwise, a review of the new changes runs when you mark it ready for review.
See this review and its findings in PostHog Review. Comment @posthog review --deep for a Deep review. A Deep review takes longer and looks deeper than a Standard review.
HostHog preview —
|
…cutor test Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
|
Risk: No findings This increment is a master merge bringing the UTM link-scanner rollout into the branch, plus the PR's wiring of the team gate in email.service.ts. The gate is fail-closed (empty or malformed config falls back to the unchanged legacy scanner), the new scanner's href rewrite only appends fully URL-encoded parameters and re-escapes the attribute value, and the merge resolution dropped nothing from master. No new security issues found. Sentinel reviewed |
👀 Auto-assigned reviewersThese soft owners were skipped because they only have minor changes here. Nothing blocks merge, so self-assign if you'd like a look:
Soft owners come from each directory's |
…-metadata Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
The executor now carries a run's queue metadata between actions on the email queue, so the teamCapped flag from one capped send reached the next email in the same dequeue and labeled its queue wait as a cap delay. Drop the flag from the executor's result; the capped send still reads it from the job's stored metadata. Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
|
/trunk merge |
|
/trunk merge |
Problem
hogflowat the wrong priority, so bulk sends can jump ahead of other work.Changes
Before:
After:
Note
During the rollout, a run an old worker rescheduled finishes at the old priority, without errors.
How did you test this code?
Test rationale: existing tests now fail without each production line.
Live run: priority on return to
hogflow(origin priority 1)03cb9b80d1bb84All runs completed. Each value comes from a
cyclotron_jobssnapshot taken as the run left the email queue. In the cap run, only the delayed send recordedteam_capped="true".Release status
Docs update
🤖 Agent context
Autonomy: Human-driven (agent-assisted)
Agent: T3 Code / Claude Code, Claude Opus 5.5. An earlier version: Codex, GPT-6.1 Sol.
Skills:
/tdd,/writing-tests,/writing-pr-descriptions,/recreating-fork-prs,qa-swarm,merge-riskMore context for AI agents
29d303f; all commits are by the PR author, so no squash.fda06d5passes the twoPushNotificationServicearguments master added, in the executor test only.0d1bb84follows a master merge that added the team sending cap'steamCappedflag (feat(cdp): label email queue waits that the team sending cap delayed #126304). The merge keeps master's cap reschedule line in the email service, and the executor drops the flag for later actions.cloneInvocationcomment does not match its code; pre-existing.keepPushRetryInEmailQueueOrder, the executor'squeueMetadataline, andwithoutTeamCapped.🤖 Generated with Claude Code