Repository navigation
fix(cdp): answer transactional email sends without waiting on kafka - #125444
Conversation
…acks The send route waited on two WarpStream produce acks for best-effort telemetry after the job was already queued, which put about 800ms on every 202. It now hands the result and status rows to the producer and replies; the queue insert and the idempotency mark stay awaited. The triggered app metric moves to the email worker, which counts a run once from a marker the API sets. Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com> Generated-By: PostHog Desktop Task-Id: 59a60ccd-2dab-47ac-8695-8d3e7a9e8eef
|
😎 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. 🚨 Comment density — 9% of added code lines are comments (16 of 175)This section warns when comments are more than 3% of the code lines a PR adds, and alerts above 6%. Before agent-assisted PRs, the typical share was about 2%. Only full-line comments count. Docstrings, generated files, snapshots, migrations, and workflow files are left out. Comments that restate the code, record how the change came about, or narrate the next line add noise for the next reader. Keep the comments that explain a reason the code cannot show, and remove the rest. See Files with the most added comment lines:
This check does not block merging. It updates on every push and clears when the share drops. |
|
Risk: No findings The only change since the last review is a no-op refactor in hog-invocation-results.service.ts: replacing Sentinel reviewed |
Rows that failed to encode returned undefined inside Promise.all, which oxlint's await-thenable rule rejects. Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com> Generated-By: PostHog Desktop Task-Id: 59a60ccd-2dab-47ac-8695-8d3e7a9e8eef
A new stamphog review started for this PR — the fresh verdict replaces this approval.
There was a problem hiding this comment.
Approved.
The risky write-path and persisted-state changes have owning-team authorship as assurance, with targeted regression tests and no outstanding substantive concerns. The supplied bot review is on an older commit and does not count as a current-head review.
- Author wrote 69% of the modified lines and has 37 merged PRs in these paths (familiarity MODERATE).
Gate mechanics and policy version
| Gate | Result | |
|---|---|---|
| prerequisites | ✓ | all clear |
| deny-list | ✓ | no deny categories matched |
| size | ✓ | 118L, 5F substantive, 226L/7F incl. docs/generated/snapshots — within ceiling |
| tier | ✓ | T1-agent / T1c-medium (226L, 7F, single-area, fix) |
| stamphog 2.6.1 | .stamphog/policy.yml @ 6c1260c · reviewed head 6c1260c |
HostHog preview —
|
|
/depot retry |
1 similar comment
|
/depot retry |
Problem
{queued: true}, ~800ms of it after the job is queued.Changes
triggeredonce, from atriggerMetricPendingmarker the API sets. Unmarked jobs from old pods aren't counted, so a rollout can dip the count but never double it.flowchart LR subgraph Before A1[Insert job] --> B1[Await results + status acks] --> C1[Await app metric ack] --> D1[202] end subgraph After A2[Insert job] --> D2[202] A2 -.-> E2[Rows to producer, acks in background] end classDef phYellow fill:#f9bd2b,stroke:#f9bd2b,color:#000; classDef phRed fill:#f54e00,stroke:#f54e00,color:#fff; classDef phGray fill:#e5e7eb,stroke:#c7ccd1,color:#000; class D1,D2 phYellow; class B1,C1 phRed; class A1,A2,E2 phGray;How did you test this code?
Test rationale: a hanging telemetry flush still gets a 202 (times out with the old await). A marked job counts once across a reschedule; unmarked jobs don't count.
Not checked: latency in prod.
Release status
Docs update
🤖 Agent context
Autonomy: Human-driven (agent-assisted)
Agent: Claude Code, Claude Opus 5.5 (
claude-opus-5-5)Skills:
/writing-tests,/writing-code-comments,/writing-pr-descriptionsMore context for AI agents
handOffQueuedRows()(gzip only, no network), not the acks.messaging_transactional_email_stage_duration_seconds{stage="total"}p95 once this ships.cdp-api.tsaround themetrics_flushstage, andcountPendingTriggerin the email worker.Created with PostHog Desktop
🤖 Generated with Claude Code