You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
{{ message }}
Repository navigation
Email outbox follow-ups from the #254 second reviews #273
Non-blocking findings from the PO's second reviews of the #254 email outbox (DOS/DOS.Me#1782 merged at 82f01409, #257 merged at 3108be3). None blocks beta; fix before mail volume grows.
Items
Purge scan cost (DOS.Me purge_outbox step 2). Rows are never deleted, so every batch scans all settled rows sequentially. Once a call passes PostgREST's 8 s statement_timeout, it rolls back and repeats daily. Add a partial index on updated_at for settled rows that still hold payload, recipient_email, to_email or recipient_user_id. Consider deleting rows older than N years.
Email hashes kept forever.to_email_hash and email_suppressions.email_hash are unsalted SHA-256, which can be reversed by guessing addresses. Clear to_email_hash for deleted accounts in purge step 1, or switch to a keyed hash (HMAC with a server secret).
Purge vs an in-flight send (step 1). Leave rows that are sending with an unexpired lease, so a mid-send row is not marked skipped/no_recipient.
A held payment request has no terminal state while its campaign stays stopped. It is retried hourly forever. Also recompute the reminder day in the payload on refresh.
An aborted claim can still commit (Give outbox.ts claim with its 10 s abort). The leased rows burn an attempt and can go dead (lease_expired) unsent on the last attempt. Log it, or lengthen the claim timeout.
Production host list.PRODUCTION_SUPABASE_HOSTS must be updated by hand if a custom Supabase domain is added. Consider asking the DB which environment it is.
Migration comment. The header of 20261123090000_give_email_outbox.sql says no shared environment ran the first draft. The PR's Supabase Preview branch did. Correct it in a later migration's notes, or leave a note here (comment-only edits to merged migrations are not allowed).
Done when
Items 1–5 are fixed with pgTAP or vitest coverage; 6–7 are decided and noted.
Item from the #254 Brevo follow-up (Give PO, 2026-11-19): send-time credit check. Not for now.
When the Brevo account runs out of email credits, Brevo does not refuse SMTP sends. It accepts them (250) and holds them in its own queue until credits come back (help.brevo.com article 115000188150, "All email credits have been used"). Give then records the row sent, nothing shows on /admin/emails, and Give's maximum ages do not apply, so a pledge reminder could arrive after its deadline. The 10k-emails-a-month plan is shared with the rest of DOS.
Proposal: before claiming, send-outbox reads the remaining email credits through Brevo's account API (GET /v3/account, plan credits). At 0 (or below a small floor) it claims nothing and reports it, so rows stay in our outbox and our max-age rules apply. Show the remaining credits on /admin/emails.
Needs a Brevo API key, a separate secret from the SMTP key (owner step).
Update to the Brevo credits item above (issuecomment-7000161949): no longer applies. JOY chose AWS SES for Give, not Brevo (#279). SES refuses a send once the 24-hour quota is used up (454 Throttling failure: Daily message quota exceeded), and Give now holds those emails visibly on /admin/emails, so no separate credit check is needed.
checkpoint: session=f288dd9f-af9e-42ae-b0d8-f40b2c2a731f Phase 1 DB PR https://github.com/DOS/DOS.Me/pull/1870 is green on final head b1ee7daf374ef5c328c649711bc3b1adbbe75e52: all 4 required CI checks pass (Give pgTAP tests (dev) 48/48 suites including 31/31 give_outbox_followups.test.sql, Supabase migration replay (dev), Repository integrity, Validate pnpm lockfile), dos[bot] approved on final head SHA, gemini-code-assist thread fixed & resolved, and fresh-context verification subagent returned CLEAN_PASS. Ready for PO acceptance; Phase 2 (DOS/Give app PR for Items 5 & 6) will follow after DOS/DOS.Me#1870 merges and Beta turns green.
checkpoint: session=f288dd9f-af9e-42ae-b0d8-f40b2c2a731f Phase 1 DB PR https://github.com/DOS/DOS.Me/pull/1870 merged into DOS/DOS.Me dev at 0223503c0195725ef56c6618bd229a5af8707468 (after PO acceptance on b1ee7daf374ef5c328c649711bc3b1adbbe75e52). Starting Phase 2 (DOS/Give app PR for Items 5 & 6).
Decision notes for Items 6 and 7 (session=f288dd9f-af9e-42ae-b0d8-f40b2c2a731f):
Item 6 (PRODUCTION_SUPABASE_HOSTS vs asking the DB): Decided not to store or query an in-DB environment marker. Production, Beta, and Supabase Preview branches all replay the exact same committed migrations from DOS/DOS.Me (manual out-of-band DB edits are forbidden by DOS/DOS.Me/AGENTS.md, and Preview branches inherit migrated rows), so an in-DB flag would be copied into Preview/Beta and fail to isolate environments. Instead, usesProductionDatabase() now checks bothPRODUCTION_SUPABASE_HOSTS / PRODUCTION_SUPABASE_REFand the JWT ref claim of SUPABASE_SERVICE_ROLE_KEY / NEXT_PUBLIC_SUPABASE_ANON_KEY, catching unlisted custom domains automatically whenever JWT keys are used while staying synchronous and fail-safe before any RPC touches the DB.
Item 7 (20261123090000_give_email_outbox.sql comment): Recorded the historical correction in the header of DOS/DOS.Me migration 20261130110000_give_outbox_followups.sql (merged in DOS/DOS.Me#1870 at 0223503c0195725ef56c6618bd229a5af8707468): lines 138–139 of 20261123090000_give_email_outbox.sql (and lines 90–91 of 20261129180000_give_outbox_and_donation_plans_late_apply.sql) stated no shared environment ran the earlier draft, whereas the PR's Supabase Preview branch did run it (Beta and Production did not). The merged migration files were left untouched.
checkpoint: session=f288dd9f-af9e-42ae-b0d8-f40b2c2a731f Phase 2 app PR #305 is green on final head 02f03f1: Lint, Build all apps, Vercel, and DOScout all pass; dos[bot] approved on final head SHA; fresh-context verification subagent returned CLEAN_PASS. Ready for PO acceptance.
Both worktrees and local branches (antigravity/give-273-outbox-followups in DOS.Me and Give) removed.
Evidence:
DOS/DOS.Me#1870 head b1ee7daf374ef5c328c649711bc3b1adbbe75e52: all 4 required CI checks green (Give pgTAP tests (dev) 48/48 suites / 31/31 new tests, Supabase migration replay (dev), Repository integrity, Validate pnpm lockfile), dos[bot] APPROVED, fresh-context reviewer CLEAN_PASS, PO accepted. Beta 0223503c0195725ef56c6618bd229a5af8707468: Supabase Preview success, Beta migration history preparation only success.
DOS/Give#305 head 02f03f111ac989f4913476dfdbb33cfe18736bdf: Lint, Build all apps, Vercel, DOScout all green, 180/180 vitest files (2622/2622 tests), dos[bot] APPROVED, fresh-context reviewer CLEAN_PASS, PO accepted. Beta 6c69036641fbffe87be6144324edbaa40678ec0f: Vercel (beta.give.vn) Deployment completed (https://vercel.com/metados/give/55mh7owjxvatPzJjNgq39Lp88MAv).
Remaining:
Promote DOS/DOS.Me (20261130110000_give_outbox_followups.sql) and DOS/Give (6c690366) from dev to main (Production) in the next owner-approved Production release, then close #273.
Next step:
Include DOS/DOS.Me0223503c0195725ef56c6618bd229a5af8707468 and DOS/Give6c69036641fbffe87be6144324edbaa40678ec0f in the next dev -> main promotion after JOY's approval.
Blockers: none (awaiting scheduled Production promotion).
Branch: merged into DOS/DOS.Medev (0223503c0195725ef56c6618bd229a5af8707468) and DOS/Givedev (6c69036641fbffe87be6144324edbaa40678ec0f); local worktrees and branches removed.
checkpoint: session=83b36fa6-8c08-49d6-aeec-63bab02a5e52 waiting for next Production promotion (dev -> main after JOY approval); Phase 1 DOS/DOS.Me#1870 merged at 0223503c0195725ef56c6618bd229a5af8707468 (Supabase Preview Beta success) and Phase 2 #305 merged at 6c69036 (Vercel https://beta.give.vn success).
Activity
JOY commentedon Nov 19, 2026
Item from the #254 Brevo follow-up (Give PO, 2026-11-19): send-time credit check. Not for now.
When the Brevo account runs out of email credits, Brevo does not refuse SMTP sends. It accepts them (
250) and holds them in its own queue until credits come back (help.brevo.com article 115000188150, "All email credits have been used"). Give then records the rowsent, nothing shows on/admin/emails, and Give's maximum ages do not apply, so a pledge reminder could arrive after its deadline. The 10k-emails-a-month plan is shared with the rest of DOS.Proposal: before claiming,
send-outboxreads the remaining email credits through Brevo's account API (GET /v3/account, plan credits). At 0 (or below a small floor) it claims nothing and reports it, so rows stay in our outbox and our max-age rules apply. Show the remaining credits on/admin/emails.JOY commentedon Nov 19, 2026
Update to the Brevo credits item above (issuecomment-7000161949): no longer applies. JOY chose AWS SES for Give, not Brevo (#279). SES refuses a send once the 24-hour quota is used up (
454 Throttling failure: Daily message quota exceeded), and Give now holds those emails visibly on/admin/emails, so no separate credit check is needed.JOY commentedon Nov 22, 2026
claim: executor=Antigravity session=f288dd9f-af9e-42ae-b0d8-f40b2c2a731f scope="DOS/DOS.Me + DOS/Give #273 email outbox follow-ups" branch=antigravity/give-273-outbox-followups target=2026-11-23
JOY commentedon Nov 22, 2026
checkpoint: session=f288dd9f-af9e-42ae-b0d8-f40b2c2a731f Phase 1 DB PR opened: https://github.com/DOS/DOS.Me/pull/1870 (head ae021cca57cdc00e8e41e26580e0a4672a4c7824, migration 20261130110000_give_outbox_followups.sql + give_outbox_followups.test.sql). Waiting on required CI checks and fresh-context review.
JOY commentedon Nov 22, 2026
checkpoint: session=f288dd9f-af9e-42ae-b0d8-f40b2c2a731f Phase 1 DB PR https://github.com/DOS/DOS.Me/pull/1870 is green on final head b1ee7daf374ef5c328c649711bc3b1adbbe75e52: all 4 required CI checks pass (Give pgTAP tests (dev) 48/48 suites including 31/31 give_outbox_followups.test.sql, Supabase migration replay (dev), Repository integrity, Validate pnpm lockfile), dos[bot] approved on final head SHA, gemini-code-assist thread fixed & resolved, and fresh-context verification subagent returned CLEAN_PASS. Ready for PO acceptance; Phase 2 (DOS/Give app PR for Items 5 & 6) will follow after DOS/DOS.Me#1870 merges and Beta turns green.
JOY commentedon Nov 22, 2026
PO acceptance: merge at b1ee7daf374ef5c328c649711bc3b1adbbe75e52 (DOS/DOS.Me#1870 -> dev)
JOY commentedon Nov 22, 2026
checkpoint: session=f288dd9f-af9e-42ae-b0d8-f40b2c2a731f Phase 1 DB PR https://github.com/DOS/DOS.Me/pull/1870 merged into DOS/DOS.Me dev at 0223503c0195725ef56c6618bd229a5af8707468 (after PO acceptance on b1ee7daf374ef5c328c649711bc3b1adbbe75e52). Starting Phase 2 (DOS/Give app PR for Items 5 & 6).
JOY commentedon Nov 22, 2026
Decision notes for Items 6 and 7 (session=f288dd9f-af9e-42ae-b0d8-f40b2c2a731f):
PRODUCTION_SUPABASE_HOSTSvs asking the DB): Decided not to store or query an in-DB environment marker. Production, Beta, and Supabase Preview branches all replay the exact same committed migrations fromDOS/DOS.Me(manual out-of-band DB edits are forbidden byDOS/DOS.Me/AGENTS.md, and Preview branches inherit migrated rows), so an in-DB flag would be copied into Preview/Beta and fail to isolate environments. Instead,usesProductionDatabase()now checks bothPRODUCTION_SUPABASE_HOSTS/PRODUCTION_SUPABASE_REFand the JWTrefclaim ofSUPABASE_SERVICE_ROLE_KEY/NEXT_PUBLIC_SUPABASE_ANON_KEY, catching unlisted custom domains automatically whenever JWT keys are used while staying synchronous and fail-safe before any RPC touches the DB.20261123090000_give_email_outbox.sqlcomment): Recorded the historical correction in the header ofDOS/DOS.Memigration20261130110000_give_outbox_followups.sql(merged inDOS/DOS.Me#1870at0223503c0195725ef56c6618bd229a5af8707468): lines 138–139 of20261123090000_give_email_outbox.sql(and lines 90–91 of20261129180000_give_outbox_and_donation_plans_late_apply.sql) stated no shared environment ran the earlier draft, whereas the PR's Supabase Preview branch did run it (Beta and Production did not). The merged migration files were left untouched.JOY commentedon Nov 22, 2026
checkpoint: session=f288dd9f-af9e-42ae-b0d8-f40b2c2a731f Phase 2 app PR #305 is green on final head 02f03f1: Lint, Build all apps, Vercel, and DOScout all pass; dos[bot] approved on final head SHA; fresh-context verification subagent returned CLEAN_PASS. Ready for PO acceptance.
fix(email): lengthen claim timeout with abort logging and harden prod…
JOY commentedon Nov 22, 2026
checkpoint: session=f288dd9f-af9e-42ae-b0d8-f40b2c2a731f Both Phase 1 and Phase 2 merged into
devand verified on Beta:DOS/DOS.Me#1870merged intoDOS/DOS.Medevat0223503c0195725ef56c6618bd229a5af8707468—Supabase Previewsuccess,Beta migration history preparation onlysuccess,Secret scan (gitleaks)success.DOS/Give#305merged intoDOS/Givedevat6c69036641fbffe87be6144324edbaa40678ec0f—Vercel(beta.give.vn) success (Deployment has completed: https://vercel.com/metados/give/55mh7owjxvatPzJjNgq39Lp88MAv).Keeping Email outbox follow-ups from the #254 second reviews #273 OPEN until the next Production promotion (
dev -> main).JOY commentedon Nov 22, 2026
handoff: session=f288dd9f-af9e-42ae-b0d8-f40b2c2a731f to=83b36fa6-8c08-49d6-aeec-63bab02a5e52
Done:
DOS/DOS.Medevat0223503c0195725ef56c6618bd229a5af8707468(migration20261130110000_give_outbox_followups.sql+ 31 pgTAP tests ingive_outbox_followups.test.sql: Items 1, 2, 3, 4, 7).DOS/Givedevat6c69036641fbffe87be6144324edbaa40678ec0f(Items 5 & 6:CLAIM_TIMEOUT_MS15 s + abort logging inoutbox.ts, JWTrefcheck inprovider.ts, plus vitest coverage).antigravity/give-273-outbox-followupsinDOS.MeandGive) removed.Evidence:
DOS/DOS.Me#1870headb1ee7daf374ef5c328c649711bc3b1adbbe75e52: all 4 required CI checks green (Give pgTAP tests (dev)48/48 suites / 31/31 new tests,Supabase migration replay (dev),Repository integrity,Validate pnpm lockfile),dos[bot]APPROVED, fresh-context reviewerCLEAN_PASS, PO accepted. Beta0223503c0195725ef56c6618bd229a5af8707468:Supabase Previewsuccess,Beta migration history preparation onlysuccess.DOS/Give#305head02f03f111ac989f4913476dfdbb33cfe18736bdf:Lint,Build all apps,Vercel,DOScoutall green, 180/180 vitest files (2622/2622 tests),dos[bot]APPROVED, fresh-context reviewerCLEAN_PASS, PO accepted. Beta6c69036641fbffe87be6144324edbaa40678ec0f:Vercel(beta.give.vn) Deployment completed (https://vercel.com/metados/give/55mh7owjxvatPzJjNgq39Lp88MAv).Remaining:
DOS/DOS.Me(20261130110000_give_outbox_followups.sql) andDOS/Give(6c690366) fromdevtomain(Production) in the next owner-approved Production release, then close#273.Next step:
DOS/DOS.Me0223503c0195725ef56c6618bd229a5af8707468andDOS/Give6c69036641fbffe87be6144324edbaa40678ec0fin the nextdev -> mainpromotion after JOY's approval.Blockers: none (awaiting scheduled Production promotion).
Branch: merged into
DOS/DOS.Medev(0223503c0195725ef56c6618bd229a5af8707468) andDOS/Givedev(6c69036641fbffe87be6144324edbaa40678ec0f); local worktrees and branches removed.JOY commentedon Nov 22, 2026
claim: executor=Antigravity session=83b36fa6-8c08-49d6-aeec-63bab02a5e52 scope="Production steps, waiting for next Production promotion (DOS/DOS.Me#1870 + #305 -> main)" branch=antigravity/give-273-outbox-followups target=2026-11-29
JOY commentedon Nov 22, 2026
checkpoint: session=83b36fa6-8c08-49d6-aeec-63bab02a5e52 waiting for next Production promotion (dev -> main after JOY approval); Phase 1 DOS/DOS.Me#1870 merged at 0223503c0195725ef56c6618bd229a5af8707468 (Supabase Preview Beta success) and Phase 2 #305 merged at 6c69036 (Vercel https://beta.give.vn success).
docs(changelog): sync CHANGELOG.md for Wave 2 (#273, #77, #291, #308, #…
Merge pull request #312 from DOS/dev
JOY commentedon Nov 22, 2026
done: session=83b36fa6-8c08-49d6-aeec-63bab02a5e52 agent=antigravity
Promoted to Production (2026-11-22):