Skip to content

fix(migrate-email): a fixed tracking enable wins, run-time clicks stay off templates - #547

Open
Silthus wants to merge 11 commits into
mainfrom
fix/migrate-email-fixed-enable-wins
Open

Silthus wants to merge 11 commits into
mainfrom
fix/migrate-email-fixed-enable-wins

Conversation

@Silthus

@Silthus Silthus commented Nov 19, 2026 •

Copy link
Copy Markdown
Contributor

Problem

#486 merged before its last review fixes landed. With the skill on main, a migrate-email run can still:

  • give a SendGrid email an open pixel it never had: a send with a fixed openTracking.enable: false can follow the account's open tracking instead.
  • move a site whose click tracking changes from send to send, such as enable: !recipient.optedOut, to a PostHog template that tracks every recipient's clicks.
  • ask the person to make a PostHog template transactional before it checks the template's value types. Making a template transactional can't be undone, and a failed check keeps the site on its provider.
  • drop a SendGrid email's open counts when the send sets only clickTracking, since the skill read that as overriding the account's open tracking too.
  • promise that turning clicks on brings back a plain-text email's click counts. PostHog tracks only the links in the HTML part.

Note

🔵 Merge risk: low, 🟡 once a release reaches people · two-way door at merge, one-way once a person applies the released skill's rewrites: the sends it rewrites stay in their app

  • A missed bug moves a Resend or SendGrid site with the wrong tracking: an email gains or loses open counts, or a site moves to a PostHog template when it should stay. Few teams run the skill, in both regions.
  • Outcomes this PR guards against once released: a SendGrid send that sets one tracking switch losing or gaining the other's account default; a site with run-time click tracking moving to a PostHog template; a PostHog template made transactional before its values pass the type check; report advice that promises clicks back for plain-text links.
  • Left open, under Known issues: the report can still suggest turning clicks on for a site whose old send tracked only some recipients' clicks, and can list an opened event for a site that moves with opens off. Nothing is tracked until the person turns clicks on.
  • Two more outcomes once released: a site with open tracking known off and an open-event webhook handler can stay on Resend or SendGrid when it could move, and a site with run-time click tracking that could use a PostHog template before now stays on SendGrid when a code send isn't possible, or moves into the code and counts no clicks for recipients SendGrid tracked.
  • Not run, read from the text only: a person who asks for a PostHog template for a site whose click tracking changes per recipient (Step 3 still keeps it off a template), the template value check that now runs before the person is asked to make the template, and the open-event handler exception in both guides. The live run below covers the four tracking outcomes, with no template asked for and no handlers.
  • Switch-off: none: the skill text is live once a release ships it. Fix forward with a new release.
  • Tier: non-critical (b to g do not hold: low grade and two-way at merge, since a separate release PR publishes the skill; no migration, release, or send)

Changes

  • sendgrid/mapping.md: each of openTracking and clickTracking with a fixed enable decides for itself, whatever the account's setting is. Each one the send doesn't set follows the account, even when it sets the other.
  • 3-inventory.md:
    • A site whose click tracking changes from send to send moves into the code, where Step 7 tracks no clicks. When it can't, it stays with click tracking set at run time.
    • The type check of a template's values now runs before the person is asked to make the template.
  • resend/account.md and sendgrid/account.md: point to Step 3's exception for a site whose open events feed a webhook handler.
  • 7-rewrite.md and 9-report.md: a plain-text link the provider tracked, such as with SendGrid's enableText: true, counts no clicks in PostHog. Step 7 notes each such site, and the report names the loss and says turning clicks on counts only HTML links.

The first commit is b5c3854..d43cc1d from #486's branch, cherry-picked onto main. The next two fix the majors its review found. Later commits tried to fix the report's click and open advice sentence by sentence; each fix created a new conflict between notes, so the last commit restores the text of the third commit. That advice is being redesigned as one rule per site class in a follow-up.

Known issues

  • major: context/skills/migrate-email/references/3-inventory.md:81: a site whose click tracking changes from send to send, such as enable: !recipient.optedOut, moves into the code with clicks off, but the plan doesn't keep the condition. The report's advice to turn clicks on for safe links could then track recipients who opted out. Tracked as a follow-up.
  • major: context/skills/migrate-email/references/sendgrid/account.md:33 and resend/account.md:37: both guides keep a site whose open events feed a handler on its provider even when its open tracking is known off. Step 3 does that only when nobody knows. The site stays, so nothing breaks. Tracked in the same follow-up.
  • major: context/skills/migrate-email/references/9-report.md:40: for a site that moves with opens off and whose open events feed a webhook handler, the "Webhook handlers" section lists PostHog's opened event as the replacement, though that send records no opens. The text is on main from feat(migrate-email): map provider tracking settings to tracking and sensitive #486. Tracked in the same follow-up.

How I checked it

At c3e3e47, with main merged at b4d7cd9 (after #541). The two conflicts, in 7-rewrite.md "Write down" and 9-report.md's notes list, keep both sides: main's note on each retry the move removed, and this PR's plain-text click notes.

  • vitest run scripts/plugins/tests scripts/lib/tests: 437 tests passed, and node scripts/build.js passed.

  • Live run: headless Claude Code (Opus 5.5, high effort) ran the built migrate-email-sendgrid bundle end to end on a generated SendGrid Node.js app, with SendGrid's open and click tracking on and plain-text click tracking off:

    Site Result
    openTracking: { enable: false }, clickTracking: { enable: true } moves with tracking: { opens: false }: the fixed setting wins over the account
    only clickTracking: { enable: false } moves with no tracking field: opens follow the account
    dynamic template, clickTracking: { enable: !recipient.optedOut } moves into the code with click tracking set at run time noted, never to a PostHog template
    clickTracking: { enable: true, enableText: true }, links in HTML and plain text the plan and the report say PostHog never counts the plain-text links' clicks
  • Shadow diff from main (b4d7cd9) to c3e3e47, both built fresh: only 3-inventory.md, 7-rewrite.md, 9-report.md, the provider account.md, and SendGrid's mapping.md in the migrate-email-resend and migrate-email-sendgrid bundles, plus manifest.json, change; every other file is byte-identical.

🤖 Agent context

Autonomy: Human-driven (agent-assisted)

  • Claude Code, Claude Opus 5.5 (claude-opus-5-5), as a worker in a T3 Code thread.
  • GPT-6.2 Sol reviewed the first commit on feat(migrate-email): map provider tracking settings to tracking and sensitive #486 and every commit here. A final read of the third commit found nothing; the open findings are listed above. After its first lane's machine was deleted, a second lane merged main and ran one review round at c3e3e47: its three majors are the Known issues above, or ask for a production-data check that doesn't apply to a skill that reads app code.

🤖 Generated with Claude Code

…eck first

Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
@github-actions

Copy link
Copy Markdown

🧙 Wizard CI

Run the Wizard CI and test your changes against wizard-workbench example apps by replying with a GitHub comment using one of the following commands:

Test all apps:

  • /wizard-ci all

Test all apps in a directory:

  • /wizard-ci ai-observability
  • /wizard-ci basic-integration
  • /wizard-ci feature-flags
  • /wizard-ci mcp-analytics
  • /wizard-ci replay-vision
  • /wizard-ci revenue
  • /wizard-ci self-driving
  • /wizard-ci warehouse
  • /wizard-ci warehouse-seeded

Test an individual app:

  • /wizard-ci ai-observability/anthropic
  • /wizard-ci ai-observability/google-adk
  • /wizard-ci ai-observability/groq
Show more apps
  • /wizard-ci ai-observability/manual-capture
  • /wizard-ci ai-observability/openai
  • /wizard-ci ai-observability/openai-agents
  • /wizard-ci ai-observability/opentelemetry
  • /wizard-ci ai-observability/vercel-ai
  • /wizard-ci basic-integration/android
  • /wizard-ci basic-integration/angular
  • /wizard-ci basic-integration/astro
  • /wizard-ci basic-integration/django
  • /wizard-ci basic-integration/fastapi
  • /wizard-ci basic-integration/flask
  • /wizard-ci basic-integration/flutter
  • /wizard-ci basic-integration/javascript-node
  • /wizard-ci basic-integration/javascript-web
  • /wizard-ci basic-integration/laravel
  • /wizard-ci basic-integration/next-js
  • /wizard-ci basic-integration/nuxt
  • /wizard-ci basic-integration/python
  • /wizard-ci basic-integration/rails
  • /wizard-ci basic-integration/react-native
  • /wizard-ci basic-integration/react-router
  • /wizard-ci basic-integration/sveltekit
  • /wizard-ci basic-integration/swift
  • /wizard-ci basic-integration/tanstack-router
  • /wizard-ci basic-integration/tanstack-start
  • /wizard-ci basic-integration/vue
  • /wizard-ci feature-flags/django
  • /wizard-ci feature-flags/next-js
  • /wizard-ci mcp-analytics/custom-dispatcher
  • /wizard-ci mcp-analytics/go-sdk
  • /wizard-ci mcp-analytics/python-sdk
  • /wizard-ci mcp-analytics/ruby-sdk
  • /wizard-ci mcp-analytics/rust-sdk
  • /wizard-ci mcp-analytics/typescript-sdk
  • /wizard-ci replay-vision/javascript-node
  • /wizard-ci replay-vision/next-js
  • /wizard-ci replay-vision/react-vite
  • /wizard-ci revenue/stripe
  • /wizard-ci self-driving/astro
  • /wizard-ci self-driving/fastapi
  • /wizard-ci self-driving/nuxt
  • /wizard-ci self-driving/react-router
  • /wizard-ci self-driving/sveltekit
  • /wizard-ci warehouse/monorepo-env
  • /wizard-ci warehouse/multi-source-next
  • /wizard-ci warehouse/stripe-node
  • /wizard-ci warehouse/zero-source
  • /wizard-ci warehouse-seeded/next-stripe
  • /wizard-ci warehouse-seeded/next-stripe-declined

Test against a wizard branch:

  • /wizard-ci all wizard:my-branch

Add wizard:<branch> to any command above to pin the wizard branch. It defaults to main.

Results will be posted here when complete.

Silthus and others added 9 commits November 19, 2026 06:08
…t clicks are lost

Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
…handler exception

Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
…h report sections

Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
…s a pixel for clicks

Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
…ck condition

Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
…racking

Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
The click and open advice added after it kept conflicting across notes;
a redesign as one rule per site class follows separately.

Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
@Silthus
Silthus marked this pull request as ready for review November 19, 2026 07:09
@Silthus
Silthus requested a review from a team as a code owner November 19, 2026 07:09
Brings in #541 (send retries left to PostHog's SDK) and #543. The two
conflicts in 7-rewrite.md "Write down" and 9-report.md's notes list
keep both sides: main's note on each retry the move removed and this
branch's plain-text click notes.

Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

1 participant