Repository navigation
docs: say when the dev console email provider runs - #4312
Conversation
Treat console email as an in-memory fallback and clear legacy console selections on boot/rebuild so a single real provider handles delivery in astro dev. Read the resolved provider for email settings to preserve the console-only display. Added SQLite runtime regressions and documented console override/multiple-provider behavior. Verified root build with increased heap, core typecheck, 79 focused tests, quick lint, formatting, docs build, and Chromium screenshots; independent follow-up review found no remaining defects. EmDash-Bot-Case: 1198246700-issue-5948867972 EmDash-Bot-Candidate: cand-1-00f8422ef6
EmDash bot: ClosedPlan The merge-conflict notification referred to the older head. The docs revision is now updated cleanly onto the newer main head dbb6e09, still with only the requested two prose changes; re-running documentation verification before repub…
Status
Next action: None. Details
Required checks on the current head:
This status is generated from recorded evidence. It is not a review and contains no instructions. |
|
There was a problem hiding this comment.
Both reviewers agree the approach is right: adding the console email plugin to fallbackProviders so the shared resolver selects it in memory only when it is the sole provider, and reading the resolved selection in Email settings. It also covers both boot and rebuildHookPipeline. Tests cover the legacy-selection and console-only cases. The two reviewers disagree on whether the cleanup of stored console selections is acceptable. One reviewer found nothing to fix and treated the behavior as documented, noting only a non-blocking follow-up: the PUT /admin/hooks/exclusive/[hookName] route can still store a console selection that the next restart or rebuild silently deletes. The other reviewer raised a blocking compatibility concern: the cleanup also deletes deliberate admin selections, and shipping that as a patch conflicts with the 1.x compatibility rule. That finding is kept below as needs_fixing.
Reviewed by anthropic/claude-opus-5-5 and openai/gpt-6.1-sol.
| if (selections.get(emailKey) === DEV_CONSOLE_EMAIL_PLUGIN_ID) { | ||
| selections.delete(emailKey); | ||
| try { | ||
| await optionsRepo.delete(emailKey); |
There was a problem hiding this comment.
[needs fixing] This unconditionally deletes deliberate console selections made through PUT /_emdash/api/admin/hooks/exclusive/email:deliver, not just legacy automatic selections. That endpoint persists an explicit provider choice, and the shared resolver normally preserves active stored selections. A developer who explicitly selected console to prevent delivery will instead send through a real provider after a restart or any plugin toggle.
The description and release notes acknowledge this, but documentation alone does not satisfy AGENTS.md's 1.x compatibility rule: breaking changes need an explicit maintainer decision and a major-version release strategy, and this changeset declares a patch. Preserve deliberate overrides while fixing the automatic fallback selection (for example with explicit-choice provenance or an opt-in migration policy), or obtain the required compatibility decision and release treatment.
Disagreement: the other reviewer (anthropic/claude-opus-5-5) approved this behavior. They considered it an accurately documented trade-off and the tests sufficient. They suggested only a non-blocking follow-up: make the PUT route skip storing fallback providers, so stored state matches the documented behavior.
There was a problem hiding this comment.
Confirmed: the old automatic-selection path and the PUT endpoint both call OptionsRepository.set with the same key and value. The options row contains only name, value, and a random revision; there is no provenance to recover. Adding an explicit-choice marker would protect future overrides, but cannot distinguish existing deliberate console choices from the reporter’s stuck automatic selection.
Preserving every unmarked legacy value would leave the reported existing-database failure unresolved; clearing them can enable real delivery for someone who deliberately chose console. I agree this needs a maintainer compatibility decision rather than treating release-note disclosure as approval. My recommendation is to preserve ambiguous legacy choices, add provenance for future explicit choices, and provide an explicit reset path for existing affected sites, accepting that this relaxes the report’s no-intervention expectation. Alternatively, the maintainer can authorize resetting legacy choices with the appropriate release treatment. I have left the published code unchanged pending that decision.
@emdash-cms/admin
@emdash-cms/auth
@emdash-cms/auth-atproto
@emdash-cms/blocks
@emdash-cms/cloudflare
@emdash-cms/contentful-to-portable-text
emdash
create-emdash
@emdash-cms/gutenberg-to-portable-text
@emdash-cms/plugin-cli
@emdash-cms/plugin-test
@emdash-cms/plugin-types
@emdash-cms/registry-client
@emdash-cms/registry-lexicons
@emdash-cms/registry-loader
@emdash-cms/registry-moderation
@emdash-cms/registry-verification
upgrade-emdash
@emdash-cms/sandbox-workerd
@emdash-cms/x402
@emdash-cms/plugin-ai-moderation
@emdash-cms/plugin-ai-search
@emdash-cms/plugin-atproto
@emdash-cms/plugin-audit-log
@emdash-cms/plugin-color
@emdash-cms/plugin-embeds
@emdash-cms/plugin-field-kit
@emdash-cms/plugin-forms
@emdash-cms/plugin-webhook-notifier
commit: |
Deploying with
|
| Status | Name | Latest Commit | Updated (UTC) |
|---|---|---|---|
| ✅ Deployment successful! View logs |
docs | 39b5ccd | Nov 05 2026, 08:12 PM |
|
CI triage: the invite failures came from the fixture’s The external Workers Builds: docs check exposes no readable log through GitHub; The legacy-selection compatibility decision from review remains unresolved; this CI follow-up does not change that policy. |
CI follow-up only: explicitly select console transport before invite tests capture its in-memory emails, because the shared fixture's real sandboxed provider now correctly takes precedence automatically. All 7 invite tests pass on Node and Cloudflare; quick lint, formatting, and diff checks pass. The aggregate Tests failure was downstream of E2E. External Workers docs logs require maintainer inspection. The legacy explicit-console compatibility blocker remains unresolved and this PR is not merge-ready pending the maintainer decision; no runtime policy was changed in this candidate. EmDash-Bot-Case: 1198246700-issue-5948867972 EmDash-Bot-Candidate: cand-2-8b0e4b4171
There was a problem hiding this comment.
Both reviewers agree the approach is right: console email is an in-memory fallback in the shared resolver, and Email settings reads the resolved selection. This covers boot and rebuildHookPipeline, and the regression tests are meaningful. The one open point is the startup cleanup that deletes every stored emdash-console-email selection. The author confirmed that stored rows carry no provenance, so legacy automatic selections cannot be told apart from deliberate admin choices, and the code is unchanged pending a maintainer decision. Because that cleanup can silently turn a deliberate no-delivery choice into real delivery in a patch release, the compatibility finding stays open and the verdict is request_changes. The anthropic reviewer commented without blocking, leaving the decision to the maintainer. A non-blocking follow-up remains: the PUT route can still store a console selection that the next restart silently deletes.
Reviewed by anthropic/claude-opus-5-5 and openai/gpt-6.1-sol.
| if (selections.get(emailKey) === DEV_CONSOLE_EMAIL_PLUGIN_ID) { | ||
| selections.delete(emailKey); | ||
| try { | ||
| await optionsRepo.delete(emailKey); |
There was a problem hiding this comment.
[needs fixing] This cleanup deletes console selections explicitly persisted through PUT /_emdash/api/admin/hooks/exclusive/email:deliver, as well as legacy automatic selections. With a real provider present, a restart or plugin toggle turns an explicit console-only choice into real delivery.
The author confirmed the stored rows have no provenance and the code is unchanged pending a maintainer decision. That ambiguity is real, but it does not authorize a breaking change in a patch release. AGENTS.md requires an explicit compatibility decision and major-version release treatment.
Preserve ambiguous existing choices, record provenance for future explicit selections, and provide an explicit reset path. Alternatively, obtain the maintainer decision and release strategy before shipping the cleanup. The docs disclose the behavior, but disclosure alone does not resolve the compatibility rule.
Disagreement: anthropic/claude-opus-5-5 did not block on this. It treated the trade-off as accurately documented and left the policy to the maintainer. openai/gpt-6.1-sol considers it blocking.
Optional follow-up from anthropic/claude-opus-5-5: make the PUT route reject or skip storing fallback providers, so stored state matches the documented behavior.
|
The new CI failure is different from the fixed invite failure: The Tests gate is downstream of this single E2E failure. A maintainer can rerun the failed shard and track the sidebar timing issue separately. The legacy console-selection compatibility decision remains the merge blocker. |
|
@emdash-autofix Since this PR opened, #2156 landed on main. It already makes the console an in-memory fallback, shows an env-selected provider in Settings (Email) when nothing is stored, and selects the console in the invite e2e tests. It also added a provider dropdown to Settings (Email), and in dev that dropdown lists the console. The startup cleanup would delete a console choice saved there on every restart or plugin toggle, and dev mail would then go out through a real plugin or env SMTP. A site that still holds an old stored console selection can switch in that dropdown instead, so the cleanup isn't needed.
|
|
Updated onto main ( The docs build and quick lint pass, formatting is clean, and I checked the rendered console section. I’ll publish this as |
Updated onto main and followed the maintainer’s docs-only direction. Restored main’s runtime, settings GET, and invite E2E versions; removed stored-console cleanup, PR-added runtime tests, and the changeset. The sole net change clarifies that console email runs when no other provider is active and explains how to select and save a real provider when an old console selection remains. Verified documentation build, zero quick-lint diagnostics, formatting, clean diff/conflict checks, rendered docs screenshot, and independent review. EmDash-Bot-Case: 1198246700-issue-5948867972 EmDash-Bot-Candidate: cand-3-b8a3ee7f73
There was a problem hiding this comment.
The docs-only approach is sound. It tells developers whose database still holds a stored console selection to choose their real provider in Settings → Email, so real delivery is never turned on silently. Both reviewers approve. The startup cleanup that was the earlier blocking compatibility concern is no longer in the diff, so that finding no longer applies. Its optional PUT-route follow-up is also moot, because a stored console choice now persists as a normal explicit selection. No bugs were found. One optional wording suggestion remains. The PR title and description still describe the earlier runtime-cleanup implementation and should be updated before merge. For existing databases the fix is now a manual step, not the no-intervention behavior the issue asked for.
Reviewed by anthropic/claude-opus-5-5 and openai/gpt-6.1-sol.
|
|
||
| That means magic links and invites work out of the box in dev: request a magic link, then copy the URL from your terminal output. You can also list captured emails at the dev-only endpoint `GET /_emdash/api/dev/emails` (and clear them with `DELETE`). | ||
|
|
||
| If **Settings → Email** still shows the console after you add a provider plugin or set up SMTP, select that provider there and save. |
There was a problem hiding this comment.
[suggestion] Optional: say why the console can stay selected. A reader may otherwise think their provider plugin is broken. The cause is a selection saved in an earlier dev session, before the real provider was added. That selection is kept until it is changed.
| If **Settings → Email** still shows the console after you add a provider plugin or set up SMTP, select that provider there and save. | |
| If you ran `astro dev` before adding a provider plugin or setting up SMTP, the console may still be saved as the selected provider, and **Settings → Email** shows it. Select the new provider there and save. |
There was a problem hiding this comment.
I’m keeping the concise, symptom-based sentence requested by @danielmlr. It also covers a deliberately saved console choice, not only an automatic selection from an earlier session. The latest submitted title is docs: say when the dev console email provider runs; its replacement description explicitly says existing sites need the manual switch and that no selection is migrated or reset.
Merged main dbb6e09 cleanly and reverified the docs-only revision. The net diff remains just the requested active-provider wording and Settings → Email selection instruction. Main’s implementation, tests, and stored console choices are unchanged; all earlier cleanup code and the changeset remain removed. Documentation build, quick lint, formatting, diff checks, rendered screenshot, and independent review pass. EmDash-Bot-Case: 1198246700-issue-5948867972 EmDash-Bot-Candidate: cand-4-b8a3ee7f73
There was a problem hiding this comment.
The docs-only approach is sound. It tells developers whose database still holds a stored console selection to choose their real provider in Settings → Email, so real delivery is never turned on silently. Both reviewers approve and found no new bugs. The earlier blocking compatibility concern about the startup cleanup no longer applies, because that cleanup is not in the diff. The PR title and description still describe the removed runtime-cleanup implementation and should be updated to match the docs-only change before merge. For existing databases the fix is now a manual step, not the no-intervention behavior the issue asked for.
Reviewed by anthropic/claude-opus-5-5 and openai/gpt-6.1-sol.
|
The latest candidate was submitted with the title @danielmlr, could you update the displayed title and description before merge if they remain stale? The description should say:
Type: Documentation; no changeset or package tests apply. Verification: docs build, quick lint (zero diagnostics), formatting, and diff checks passed. The earlier runtime-cleanup claims and admin screenshots should be removed; the current rendered-docs screenshot is here. |
What does this PR do?
Treats
emdash-console-emailas a fallback during exclusive hook resolution, so a single real email provider wins inastro dev. Console-only selections stay in memory rather than being persisted.Clears previously stored console-email selections before resolving providers on boot or pipeline rebuild. Cleanup is limited to console email; deliberate stored choices of the built-in comment moderator retain their current behavior. Email settings reads the resolved provider from the pipeline so a console-only site still displays
emdash-console-email, not Unknown.Compatibility: stored console choices cannot be distinguished from legacy auto-selections, so all are cleared, including choices made through the admin API. Developers who need to prevent real delivery should disable or omit real providers in development, rather than pin the console. With multiple real providers and no saved real-provider choice or preferred hint, email is unconfigured until a provider is selected through the admin API. This keeps the console a fallback rather than a durable override. These cases are documented in the email guide and changeset.
Adds real-SQLite runtime regression coverage for fresh and legacy selections, settings API output, delivery through the selected real provider, and disable/enable rebuilds. The four new runtime tests reproduced the original failure; the settings assertion separately reproduced the missing in-memory-provider display found during review.
Closes #4311
Type of change
Your connection to this change
Prepared by the project-operated autofix bot through issue auto-intake, under the project-bot exception in AI_POLICY.md. Maintainer review is required before merge.
Checklist
pnpm typecheckpassespnpm lintpassespnpm testpasses (or targeted tests for my change)pnpm formathas been runFull-workspace typecheck and type-aware lint are left to CI; focused core typecheck and quick lint pass.
AI assistance disclosure
Screenshots / test output
Verification:
NODE_OPTIONS=--max-old-space-size=6144 pnpm build— passes (default heap initially ran out of memory).pnpm --filter emdash typecheck— passes.pnpm lint:quick— zero diagnostics.pnpm formatandgit diff HEAD --check— pass.pnpm --dir docs build— passes.pnpm --filter emdash exec vitest run tests/integration/runtime/create.test.ts tests/unit/plugins/exclusive-hooks.test.ts tests/integration/comments/hooks.test.ts tests/unit/api/email-settings-route.test.ts— 79 tests pass.Playwright Chromium with a local
real-emailstub provider (no external delivery). The before state was recreated by explicitly selecting console email through the admin API; restarting Astro against the same SQLite database automatically selected the real provider. No admin layout or copy changed.Before restart:

After restart:

Fresh console-only site, with no stored email selection:

The EmDash bot took this issue on automatically when it was opened; no maintainer has assigned it yet.