Repository navigation
Conversation
|
Merging to
After your PR is submitted to the merge queue, this comment will be automatically updated with its status. If the PR fails, failure details will also be posted here |
…ts workflow Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
…rite changes a template rewrite_email_asset_url saved message template content directly, so a transactional template's workflow kept its old copy. Template saves from the API, the design patch and the rewrite now share one locked save-and-sync path in services/template_saves.py. Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
Silthus
force-pushed
the
fix/rewrite-email-asset-url-sync
branch
from
October 20, 2026 03:27
c90e0ca to
9eee7cf
Compare
…d draft Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
A draft saved before a rewrite kept the old URL, and publishing it brought that URL back. The rewrite now finds and rewrites draft_content too. A draft-only rewrite saves the draft alone and writes no workflow version, because sends never read the draft. Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
This was referenced Nov 2, 2026
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
rewrite_email_asset_url, a transactional template's sends can keep the old asset URL.--targets message_templatesor--id <template id>. A default run also rewriteshog_flowsin place, so sends get fixed there, but the workflow gets no new version.Merge Danger
Warning
🟡 Merge risk: medium · two-way door (merge-risk rubric)
Changes
services/template_saves.py: the API update, the design patch, and the rewrite command. It locks the template row, checks the workflow-editor permission, checks the template can still send, saves, and syncs the workflow.draft_content, added in feat(workflows): draft and publish edits to transactional email templates #118664). Before, a draft saved before a rewrite kept the old URL, and publishing it brought that URL back.lock_transactional_workflow_id,check_transactional_update,update_templateandedit_content_lockedare gone. Nothing else called them.Rebase note
#118924 moves this same orchestration into
services/template_saves.py(save_template/save_locked_template), with a write intent and a content hash. This PR uses the same file, names and signatures, minus those two parameters, so whichever lands second resolves the conflict to #118924's version of the shared functions.rewrite_contentintemplate_saves.py, so the rewrite records a content hash too.rewrite_contentontosave_locked_template.How did you test this code?
Test rationale: one case in
TestTransactionalEmail(products/messaging/backend/tests/api/test_transactional_email.py) catches a rewrite that saves the template without syncing its workflow. The closest existing test,test_saving_a_transactional_template_writes_a_new_workflow_version, covers the API update only. The rewrite command tests inproducts/workflows/backend/test/test_rewrite_email_asset_url.pynever make a template transactional.rewrite_template_content, the messaging facade function the command calls for message templates, and the command itself for drafts.TestRewriteEmailAssetUrl(products/workflows/backend/test/test_rewrite_email_asset_url.py) catches a rewrite that skips a template whose draft alone holds the URL. Red before the fix: the command matched 0 rows.assert 1 == 2). At HEAD, the transactional email, template API, design operation and rewrite command test files all pass. They pass again after the rebase onto feat(workflows): draft and publish edits to transactional email templates #118664.Live run
rewrite_email_asset_urlon a local database, each template made transactional first. URLs arehttps://assets.example.com/{old,new}.png.--id A--id B, row written by base code--targets message_templates, row written by HEADA second run covers a transactional template whose draft alone holds
https://assets.example.com/draft-old.png.--id A--id BNot run: the plugin server, so the worker reload after commit was not observed. It is scheduled with
on_commit, as the API save already does.Proofs (per
qa-swarmPROOF.md)Release status
Docs update
None. The command's behavior is documented in its own help text, which is unchanged.
🤖 Agent context
Autonomy: Human-driven (agent-assisted)
Agent: Claude Code, Claude Opus 5.5 (claude-opus-5-5)
tdd,/writing-tests,/writing-pr-descriptions,pr-description,merge-risk.example.comURLs).Decisions
template_saves.pynames and signatures, so the rebase is a straight conflict resolutionInvolvement: no grilling rounds, no prototypes. Review: one GPT-6.1 Sol review (high effort) on
c90e0ca, no findings; one note on sender reuse corrected this description. Final GPT-6.1 Sol reads (high effort) of the rebase onto #118664 and of the draft rewrite found nothing. Proof: live run captured.🤖 Generated with Claude Code