Repository navigation
feat(cdp): add the email attachments table to cyclotron - #127995
Merged
Merged
Conversation
…il route A code send posts its accepted content to transactional_email/send. The route runs the same reserve, replay, refusal and enqueue steps as a template send. The accepted send binds the idempotency fingerprint, and a miss on a new workflow reads it from the primary. Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
…flow Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
…ode-send Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
…ode-send Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
A send with captureEngagement false still put the recipient's distinct_id in its SES header and pixel/redirect tracking codes. Minting still emits the v2 payload, which has no capture choice, so the SES delivery, bounce, open and click callbacks for that send captured engagement events. Every reader skips engagement capture for a code without a distinct_id, so leaving it out honors the choice on every deployed reader now. The v3 payload and its minting switch stay as they are. The send-time capture and the message assets row keep their distinct_id. Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
The capture-off fix also changed the pixel and redirect codes that dev and test mint, but only the SES header path had a test. The tracking URL test now runs per capture choice and fails if those codes keep the distinct_id of a capture-off send. Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
A code send accepts up to 10 cc and 10 bcc addresses. The route checks every recipient before the 202: a malformed, suppressed or unreachable copy refuses the whole send with the code `to` would get. The accepted send now refuses unknown fields, so a newer caller never loses one. Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
A capture-off send already mints its v2 codes without a distinct_id, and every reader skips engagement capture without one. The v3 capture-choice payload was never minted, so remove its marker, parser branch, rollout constant and the captureEngagement fields that only fed it. Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
A queued job for a deleted workflow read the primary on every batch, one writer query per missing id. Remember ids the primary confirmed missing for 60 seconds (bounded to 10,000 ids, cleared by a reload), and read a batch's replica misses from the primary in one query while keeping the in-flight dedupe. Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
Contributor
🤖 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. |
A workflow the replica did not have yet was read from both databases on every send and worker batch until replication caught up. Keep what the primary returned, hit or miss, for 60 seconds (bounded to 10,000 ids, cleared by a reload naming the id), so later lookups read neither database; after expiry the replica is read first again. The send-route and worker tests now hide the row from the replica at the query boundary, so they cover a replica miss followed by a primary hit. Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
A primary read that started before a reload could resolve after it and store the old state for the next 60 seconds, so a workflow disabled or paused during that read kept sending. A reload now drops the in-flight read, and a read that a reload overtook returns its rows to its own callers but stores nothing. Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
# Conflicts: # nodejs/src/cdp/services/hogflows/actions/hog_function.ts
…/13-cdp-code-send-copies
…' into email-v2/13b-cdp-email-attachments-table
Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
…-email-attachments-table
Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
A newer Django can send a field this cdp-api does not deliver, such as cc, bcc or attachments. Before this, the field was dropped, the send went out without it, and the caller saw a 202. Now the send answers 400 invalid_request. Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
…and tracking The outer send object refused unknown fields, but content, from and tracking still dropped theirs, so a newer caller could get a 202 for an email sent without them. Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
# Conflicts: # nodejs/src/cdp/services/hogflows/transactional-email.ts
…' into email-v2/13b-cdp-email-attachments-table
Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
# Conflicts: # nodejs/src/cdp/services/hogflows/hogflow-executor.service.test.ts
Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
…' into email-v2/13b-cdp-email-attachments-table
The code-key and capture tests sent real email through the shared maildev, which races email.service.test.ts clearing the same inbox when both files run in one CI shard. Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
The template route now requires a token without a kind claim, and the code send route keeps requiring kind code_send, so neither token works on the other route. Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
This was referenced Nov 4, 2026
Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
6 tasks done
Silthus
added a commit
that referenced
this pull request
Nov 4, 2026
Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
4 of 5 tasks
Silthus
marked this pull request as ready for review
November 4, 2026 10:12
|
Risk: No findings This PR adds one idempotent migration creating the Sentinel reviewed |
Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
…tachments-table Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
|
😎 Merged successfully - details. |
mayteio
approved these changes
Nov 4, 2026
…ail-attachments-table # Conflicts: # nodejs/src/cdp/cdp-api.serial.test.ts
Contributor
Author
|
/trunk merge |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Add this suggestion to a batch that can be applied as a single commit.This suggestion is invalid because no changes were made to the code.Suggestions cannot be applied while the pull request is closed.Suggestions cannot be applied while viewing a subset of changes.Only one suggestion per line can be applied in a batch.Add this suggestion to a batch that can be applied as a single commit.Applying suggestions on deleted lines is not supported.You must change the existing code in this line in order to create a valid suggestion.Outdated suggestions cannot be applied.This suggestion has been applied or marked resolved.Suggestions cannot be applied from pending reviews.Suggestions cannot be applied on multi-line comments.Suggestions cannot be applied while the pull request is queued to merge.Suggestion cannot be applied right now. Please check back later.
Problem
Transactional email attachments (#127986) need a cyclotron table before the service code that uses it deploys. Migrations deploy apart from services, so the table lands first in its own PR.
Changes
cyclotron_email_attachments: one row per file, keyed by the email job's id.cyclotron_jobs.state, so lifecycle snapshots in Kafka and ClickHouse never carry them.job_idfor the worker andcreated_atfor the janitor's sweep.job_idhas no foreign key, because the janitor deletes finished jobs on its own schedule. A row outlives its job only until the sweep.positionkeeps the files in the order the caller sent them.sha256andsize_byteslet the worker refuse a file that changed or went missing, and let the janitor report the table size without reading the bytes.attachments_missing.Note
Merge danger: low, two-way door. A new, empty table that nothing reads until #127986 deploys.
How did you test this code?
Test rationale: no new test. The cdp test suites in #127986 run against this table.
rust/bin/migrate-entry cyclotron-node --freshapplies every cyclotron-node migration, this one last, on a scratch database.mastertoo until chore(cohorts): recover test readers from kafka transport errors #127882, which has merged. This branch picks up the fix with its nextmastermerge.Migration run excerpt
The full log lives in private proof storage.
Release status
Docs update
🤖 Agent context
Autonomy: Human-driven (agent-assisted)
Agent: Claude Code, Claude Opus 5.5 (
claude-opus-5-5)Skills:
/writing-pr-descriptionsMore context for AI agents
migrations-separationrefuses a migration beside service code.🤖 Generated with Claude Code