Skip to content

Promote dev to main: Campaigns wave (#250-#253, #265-#288), email outbox (#254) & monthly plan A (#275/#276) (2026-11-22) - #301

Merged
JOY (JOY) merged 23 commits into
mainfrom
dev
Nov 22, 2026
Merged

JOY (JOY) merged 23 commits into
mainfrom
dev

Conversation

@JOY

Copy link
Copy Markdown
Contributor

Owner JOY authorized preparing both Production promotion PRs on 2026-11-22, at dev c5956769 (c59567691c6a3d1001106c29caad2aa763306c29). A merge into main deploys https://give.vn on Vercel.

Important

DO NOT MERGE BEFORE DOS/DOS.Me main: This PR MUST wait until the parallel DOS/DOS.Me selective DB promotion PR merges into DOS/DOS.Me main and all 7 required give migrations are applied to Production Supabase (app code unconditionally reads new columns such as organizers.handle/bio, contributions.plan_id/plan_period, and give.donation_plans).

AWS SES Sandbox Posture: Keep SMTP_USER and SMTP_PASS unset on Vercel Production until AWS SES exits sandbox. While unset, /api/cron/send-outbox returns 503 email_not_configured without claiming rows, leaving all user flows unaffected and queued outbox rows safely pending (never burned to dead).

Required DOS/DOS.Me migrations (must land on Production first)

  1. 20261123090000_give_email_outbox.sql (#254 / DOS/DOS.Me#1782)
  2. 20261124090000_give_email_outbox_hold.sql (#254 / SES daily quota hold)
  3. 20261125120000_give_donation_plans.sql (#275 / DOS/DOS.Me#1824)
  4. 20261129120000_give_campaign_analytics.sql (#263 / DOS/DOS.Me#1852)
  5. 20261129150000_give_campaign_comments.sql (#262 / DOS/DOS.Me#1853)
  6. 20261129160000_give_organizer_public_profile.sql (#261 / DOS/DOS.Me#1851)
  7. 20261129170000_give_campaign_members.sql (#264 / DOS/DOS.Me#1856)

dev is ahead of main by (23 commits)

Campaigns Wave (#250–#253)

Campaigns Waves 4–6 (#265–#288, no database change)

Platform — Email Outbox (#254)

Money — Monthly Donations Plan A (#275/#276)

Docs, Config & Dependencies

Pre-merge & Post-deploy Verification Checklist

  • DOS/DOS.Me selective DB promotion PR merged to DOS/DOS.Me main and all 7 migrations verified on Production Supabase.
  • Confirm Vercel Production env vars: GIVE_RATE_LIMIT_SECRET (>= 32 chars) and CRON_SECRET (>= 16 chars) present; SMTP_USER / SMTP_PASS kept unset while AWS SES is in sandbox.
  • Vercel Production build for main succeeds and serves https://give.vn.
  • Smoke-check public pages: /, /campaigns, /campaigns/[slug] (#binh-luan comments tab, BreadcrumbList JSON-LD, YouTube/milestones, analytics beacon POST /api/analytics/event), /u/<nonexistent> returns clean 404.
  • Smoke-check authenticated & staff pages: /me (public profile editor), /me/campaigns, /me/campaigns/[id] (Thống kê, Đội ngũ, status history, draft updates, monthly toggle), /me/contributions, /admin, /admin/reports/comments, /admin/emails.
  • Verify Vercel Crons: issue-plan-donations, plan-notices, purge-outbox return 200; send-outbox returns 503 email_not_configured (expected while SES credentials remain unset in sandbox).

JOY (JOY) and others added 23 commits November 19, 2026 04:26
…259) (#265)

- Revalidate /admin/reports on reportCampaign, organizer/notice/public routes on approveCampaign, requestChanges, and setVerification, and organizer/pledge/statement/contribution routes on moderateCampaignReports suspend and stop_payment_requests.
- Filter concurrently-resolved campaign IDs and clamp/reload the new last page in listCampaignReportQueue so moderators are never stranded on a phantom empty page.
- Chunk loadUnresolvedForCampaigns by CAMPAIGNS_PER_REQUEST (100), add id DESC tie-breaking on resolved reports, and harden parseReportsPage with /^[1-9][0-9]*$/ capped at 10,000.
… ranking (#260) (#266)

Co-authored-by: Qwen-Coder <qwen-coder@alibabacloud.com>
…ix organizer/activate revalidations (#258) (#267)

* fix(campaigns): prevent replaced-cover exposure, guard cleanup, and fix organizer/activate revalidations (#258)

- Require coverResponse to match the active campaigns.cover_media_fk cover_media_id, add X-Content-Type-Options: nosniff on cover responses and X-Robots-Tag: noindex, noimageindex on private covers, and lazily open dbService only after viewer access succeeds.
- Re-read active cover_media_id after uploadCover commits and best-effort delete all superseded image rows/objects inside try/catch; guard deleteDraft post-commit Storage cleanup in try/catch; normalize blank cancelCampaign reasons to null, use cancellation-specific error messages, and revalidate /admin on submitForReview and cancelCampaign.
- Recover from concurrent initial saveOrganizer 23505 races via update by user_id and revalidate /, /campaigns, /campaigns/[slug], /me/campaigns/[id], /admin, and /admin/reports; revalidate /campaigns/[slug]/pledge in reward-actions and /me/pledges/[code] in fulfillment actions.
- Validate non-negative integer output and catch thrown RPC errors in GET /api/cron/activate, revalidate downstream routes when activated > 0, and add route/unit tests for activate cron, public/private cover routes, coverResponse, and reencodeCover.

* fix(campaigns): use optimistic CAS for cover swaps and revalidate account routes (#258)

- Replace the post-update cover_media_id re-read and neq("id", activeCoverId) sweep in uploadCover with optimistic compare-and-swap against prevCoverId (retrying up to 3 attempts on concurrent cover updates) and delete only the atomically replaced prevCoverId row + Storage object so ON DELETE SET NULL and in-flight sibling uploads are never clobbered.
- Revalidate /me/accounts, /admin/accounts, and /admin/account-swaps in saveOrganizer when organizer identity/verification state changes.
* Dependabot: open PRs against dev (#163)

Dependabot reads its configuration from the default branch, main, whose
copy lacked the target-branch lines #117 added on dev, so it opened #160,
#161 and #162 against main. This makes main's file identical to dev's.

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

* feat(email): outbox sender, first transactional emails, admin view (#254)

The send-outbox cron leases due give.outbox rows, renders Vietnamese
emails (donation receipt with a guest tracking link, pledge payment due,
reminder and lapsed, campaign approved, changes requested, suspended,
ended) and sends them through DOS.Me's AWS SES over SMTP; results go back
through give.complete_outbox (retry with backoff, dead after 7 attempts).
/admin/emails lists dead and retrying emails and retries a dead one.
Notification emails carry an unsubscribe link and one-click header.
Guest access accepts the receipt's tracking token.

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

* feat(email): nodemailer 10.3.1 for SES, log transport outside Production (#254)

Per the Give Product Owner: nodemailer pinned to 10.3.1, imported only by
server-only code (tested); Give's own sender Give <no-reply@give.vn> and no
default Reply-To. Beta, previews and local runs use a log transport that
mails nobody unless EMAIL_DELIVERY=smtp, and then only EMAIL_ALLOWLIST;
@retry.invalid and @bounce.invalid fail on purpose to test retries and dead
rows. Production without SES credentials claims nothing.

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

* docs(changelog): link #257

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

* fix(email): send deadline, release unreached rows, pooled SMTP (#254 review)

- No send starts unless it can time out by 45 s; rows the run cannot reach
  go back uncounted through give.release_outbox instead of waiting out the
  lease and spending an attempt.
- After a send times out the run stops, gives back the rest of the batch
  and closes the transport, so the stuck connection is dropped.
- One pooled SMTP connection per run, closed at the end.
- Outside Production the job refuses to run against the Production
  database, so the log transport never marks real people's emails sent.

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

* fix(email): link origin reads only the given env (#254)

siteOrigin() defaults to process.env.NEXT_PUBLIC_SITE_URL when passed
undefined, so emailLinkOrigin ignored the env it was given.

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

* fix(email): second review of #257: cut timed-out sends, retry results, guards (#254)

- A timed-out send has its SMTP connection destroyed (tracked sockets via
  nodemailer getSocket) before anything is recorded, and is recorded as
  outcome unknown (complete_outbox p_outcome_unknown: waits an hour).
- complete_outbox is tried 3 times before the row is left to its lease.
  Delivery is documented as at least once.
- Production refuses EMAIL_DELIVERY=log and non-https link origins; the
  Production DB guard also knows dos.supabase.co.
- Only an EENVELOPE refusal at RCPT TO is permanent.
- X-Give-Outbox-Id header (SES replaces Message-ID).
- Receipt shows the amount only for VND; the changes-requested subject
  leaves out the not-yet-approved title.
- The nodemailer import guard catches dynamic, require and subpath imports
  and a use client directive after comments, in js and mjs files too.

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

* fix(email): bound result retries by the run deadline; purge cron; review fixes (#254)

- complete_outbox and release_outbox calls time out after 5 s, retries run
  only for transient errors and only while they fit before 55 s; a stale
  answer after a lost one reads what the row recorded.
- SMTP abort resets connections (TCP RST) and fails connects in progress;
  a connection lost before the provider answered is outcome unknown.
- /api/cron/purge-outbox (daily) runs give.purge_outbox.
- Admin: labels for the new skip reasons, message for an expired retry.
- Import guard catches side-effect and template-literal imports; the
  Production DB guard ignores a trailing dot.

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

* fix(email): outcome unknown only after MAIL FROM; bound claim and stale read (#254)

- smtp: nodemailer's transaction log (commands only, nothing kept) tells
  whether a send reached MAIL FROM; a connection lost before that is a
  plain failure, not outcome unknown.
- outbox: claim_outbox times out after 10 s; the stale-answer read runs
  only while it fits before 55 s.
- purge-outbox route: maxDuration 60. Docs updated.

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

* fix(email): purge in 4 s calls until done; timeout before MAIL FROM is a plain failure (#254)

- /api/cron/purge-outbox calls give.purge_outbox again while it reports
  more, for up to 45 s (server/email/purge.ts).
- The transport reports whether the last send reached MAIL FROM; a send
  that timed out before that is retried normally, not as outcome unknown.

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

---------

Co-authored-by: Claude Opus 5.5 <noreply@anthropic.com>
… sync changelog (#270) (#271)

* fix(campaigns): fix ShareButtons timer race, add component tests, and sync changelog (#270)

- Track ShareButtons clipboard status timeout in a useRef, clear pending timers before rescheduling on rapid clicks, and clean up on unmount
- Add Vitest suites for ShareButtons, Markdown, CopyButton, and ProgressBar
- Sync reverse-chronological line:campaigns entries in CHANGELOG.md

* docs(changelog): record PR #271 for #270

Co-authored-by: Qwen-Coder <qwen-coder@alibabacloud.com>

---------

Co-authored-by: Qwen-Coder <qwen-coder@alibabacloud.com>
…one reached display (#268) (#272)

Co-authored-by: Qwen-Coder <qwen-coder@alibabacloud.com>
* Dependabot: open PRs against dev (#163)

Dependabot reads its configuration from the default branch, main, whose
copy lacked the target-branch lines #117 added on dev, so it opened #160,
#161 and #162 against main. This makes main's file identical to dev's.

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

* docs(design): recurring monthly donations model, section 4.3 (#255)

Compare a reminder-based monthly plan, donor-set standing orders,
Tingee Direct Debit and bank direct debit against D3, Decree 93 and
the ledger, statement import and Tingee channel. Recommend the
reminder-based plan and sketch its tables, functions and tests.

Refs #255

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

* docs(design): address review of section 4.3 (#255)

Scope Decree 93 rules to disaster/epidemic/incident campaigns, mark
Tingee Direct Debit inferences, fix cron lock order, catch-up,
reminder idempotency, QR cutoff and timezone, and cover reused codes,
plan edits and the organizer toggle.

Refs #255

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

* docs(design): record JOY's choice for monthly donations and add A+ (#255)

JOY chose option 2 on 2026-11-19: reminder-based monthly plans (A) first,
then donor-set standing orders with a fixed plan code (A+) as a separate
step gated on a verified bank and counsel's answers.

- Add D9 to the decision table and the monthly-donation counsel
  questions to P4.
- Split 4.3 into decision and order (4.3.3), design A (4.3.4) and
  A+ (4.3.5) with the GM plan code, plan-based matching, same-month
  second transfers, after-close handling and the stop-the-order notice.
- Address the second review: plans need ends_at; honest text on saved
  templates; QR visibility computed at display time; end notices for
  every ending path via the plan-notices job; no-login stop token with
  List-Unsubscribe; account deletion; due-date rule; lock modes; Tingee
  follow-up skips VietinBank and VA-only accounts; anonymity warning;
  merged campaign_ended into campaign_closed; TT 15/2024 Art. 3 and 9.

Refs #255

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

* docs(design): fix review of monthly A/A+ design (#255)

- Account deletion handles every plan of the user, not only active ones.
- Tingee follow-up re-checks plan, campaign and period under locks.
- Cron ends plans past ends_at before skipping suspended campaigns.
- A+ creates no donation at sign-up; A then A+ in one month gives two
  donations; GM money to a swapped or reused account still alerts the
  donor; A+ refused where the channel drops transfer content.
- Fixed platform floor instead of campaigns.min_contribution; lock modes
  for the deletion hook and plan-notices; 90 days can touch 5 months;
  webhook/statement pairing; citation and wording fixes.

Refs #255

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

* docs(design): add option C, recurring charges through a licensed gateway (#255)

JOY asked on 2026-11-19 whether Give can offer card or wallet plans like
other platforms. Option C is researched as the alternative to A+ for step 2;
JOY's A + A+ pick stands until JOY chooses between A+ and C. A stays step 1.

- docs/research/recurring-payment-gateways.md: MoMo, ZaloPay, Bao Kim,
  VNPAY, OnePay, Alepay, 2C2P, ShopeePay, Stripe, PayPal; GoFundMe,
  Kickstarter Pledge Over Time, Patreon, Stripe Connect charge types;
  Decree 52/2024, Circulars 40/2024, 15/2024, 18/2024, 50/2024, Decree 93
  and the e-commerce law. Every claim tagged read, search or inference.
- Design 4.3.6: option C, fit with D3, legal risks, cost to organizers and
  what JOY would sign up for; row C in 4.3.1; D9, 4.3.3 and P4 updated.

Refs #255

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

* docs(design): fix review of option C (#255)

- Wallet bullet and conclusion in 4.3.1 point to C instead of ruling out
  direct settlement; TT15 row and Art. 4.3 row cover C.
- Baokim: a sub-merchant balance exists, who controls payouts is unknown.
- Platform contract form waits for a yes on direct settlement; DOS must
  not be the party that receives money.
- Stopping on time needs a confirmed cancel when the gateway runs the
  schedule; Art. 17.2 scoped to d93_disaster; card vs wallet authorisation
  with TT18 Art. 16.6 and TT50 tagged as search-only.
- Tag fixes (VNPAY presence, 2C2P, Kickstarter shortfall), Stripe and
  PayPal cell, Art. 3.18 wording, Decree 52 and Circular 40 amendment
  caveats, P4 columns name C.

Refs #255

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

* docs(design): record parallel step 2 and fix third review (#255)

JOY chose to run the gate checks for A+ and C in parallel; whichever
passes first is built first. Record that in D9, 4.3 and 4.3.3.

Fix the PO's review of option C:
- GoFundMe and Kickstarter use a processor-held balance, not direct
  settlement; whether that fits D3 and D93 Art. 17.2 is P4(j).
- A+ stays off for d93_disaster unless counsel answers P4(c) yes.
- A+ money in a reused account: block release for 3 months unless donors
  confirm cancelling; otherwise the organizer refunds the sender.
- One-time suspension notice for A+ donors.
- Matching, check character, Tingee pairing, nullable plan fields, token
  cleanup on deletion, MoMo expiryDate, and citation fixes.

Add docs/research/recurring-step2-outreach.md: the gateway letter and
the standing-order bank test, in Vietnamese.

Refs #255

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

* docs(design): fix review of step 2 revision (#255)

- Misdirected A+ money: flag it on no-campaign transactions too, never
  explain it as other_in, refund the sender by default and link the pair
  with give.link_misdirected_return (a fifth reclassification row).
- Hold release and swap re-bind per A+ plan until the donor confirms
  cancelling or the plan has been ended and quiet for 3 months, with a
  staff override; apply it on every release branch.
- Matcher: GV wins over GM, scan all GM codes, stop early on matched
  transactions, send ambiguous pairs to staff; tingee.md 8.4 counts GM.
- Suspension notice re-checks the plan and ends_at.
- Gateway letter: seven questions, citation consent, private storage.
- Bank test: cross-bank monthly pass rule, real-format test codes.
- Stale decision wording, 120-day wording and citations.

Refs #255

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

* docs(design): fix second review of step 2 revision (#255)

- Misdirected A+ money: plan-notices sends the notices under the normal
  campaign-then-plan locks; tell the organizer, give them a view of
  their accounts, and handle pairs with no campaign on either side.
- Account hold: let a swapped-out account re-bind once donors confirm
  moving the order or it goes quiet; persist the staff override.
- Matcher: define a valid GV code, stop on any ledger post, refuse
  manual matching of misdirected money.
- Gate (a) is monthly and cross-bank; fee and c' wording; schema order;
  outreach letter says the design doc is public.

Refs #255

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

* docs(design): tighten step 2 outreach and record A+ follow-ups (#255)

Bank test: the receiving account must not be bound to Give on prod, read
statements only in the bank app or on beta/preview, black out the sender's
name, and record sender and receiver banks; a sender is fully verified only
after a second receiving bank passes. Reserve the two published test codes.

Gateway letter: name MCC 8398 and ask about organisation organizers; add Q8
on contract structure and DOS licensing and Q9 on limits and authentication;
extend the selection rule. GoFundMe has no fixed payout schedule. Note the
six open A+ points tracked for the A+ DB issue.

Refs #255

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

---------

Co-authored-by: Claude Opus 5.5 <noreply@anthropic.com>
…milestone edit (#269) (#274)

Co-authored-by: Qwen-Coder <qwen-coder@alibabacloud.com>
…#283) (#285)

* feat(campaigns): add BreadcrumbList JSON-LD and sync Wave-4 changelog (#283)

- Emit XSS-safe schema.org BreadcrumbList JSON-LD (<script type="application/ld+json"> serialized with .replace(/</g, "\\u003c")) on public non-preview, non-halted /campaigns/[slug] views, resolving absolute item URLs against siteOrigin() when configured and omitting item on the final current-page ListItem
- Add Vitest coverage for BreadcrumbList structure, category inclusion/omission, </script> and <!-- \u003c escaping, and suppression on preview, suspended, and cancelled views
- Sync reverse-chronological Wave-4 line:campaigns entries (#269 / #274, #268 / #272) and tighten #258 / #267 uploadCover CAS wording in CHANGELOG.md

* docs(changelog): record PR #285 for #283

Co-authored-by: Qwen-Coder <qwen-coder@alibabacloud.com>

---------

Co-authored-by: Qwen-Coder <qwen-coder@alibabacloud.com>
…Wave-5 changelog (#287) (#288)

* feat(campaigns): show status history in organizer workspace and sync Wave-5 changelog (#287)

- Load listStatusEventsByCampaign(db, [campaign.id]) inside Promise.all on /me/campaigns/[id] with .catch(() => new Map()) resilience and render <StatusHistory> inside #status, replacing the empty-actions placeholder on locked statuses and sitting cleanly above #status controls when actionable
- Add RSC Vitest coverage in apps/web/src/app/me/campaigns/[id]/page.test.ts for rendered status transitions, multiline review reasons, actor_id exclusion, and graceful degradation on campaign_status_events errors
- Sync reverse-chronological Wave-5 line:campaigns entries (#287, #281 / #286, #282 / #284) in CHANGELOG.md

* docs(changelog): record PR #288 for #287
…254) (#279)

* feat(email): Brevo SMTP by default, hold on account-wide refusals (#254)

The transport takes host, port, login and key from env, by default Brevo's
relay (smtp-relay.brevo.com:587, STARTTLS). Brevo's two documented 450
account refusals hold the email (complete_outbox p_hold, ACCOUNT: in
last_error) and stop the run; /admin/emails lists held emails with when
each expires. Brevo queues email on its side when credits run out, which
the design now notes.

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

* fix(email): review of the Brevo switch: old-DB fallback, NULL errors listed (#254)

A hold refused by a database without p_hold is recorded as an ordinary
failure instead of left to its lease; retrying rows with no last_error
stay listed; Brevo's former sendinblue.com host is recognised; the banner
lists maximum ages by kind.

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

---------

Co-authored-by: Claude Opus 5.5 <noreply@anthropic.com>
Bumps [read-excel-file](https://gitlab.com/catamphetamine/read-excel-file) from 9.3.13 to 9.3.17.
- [Changelog](https://gitlab.com/catamphetamine/read-excel-file/blob/master/CHANGELOG.md)
- [Commits](https://gitlab.com/catamphetamine/read-excel-file/compare/v9.3.13...v9.3.17)

---
updated-dependencies:
- dependency-name: read-excel-file
  dependency-version: 9.3.17
  dependency-type: direct:production
  update-type: version-update:semver-patch
...

Signed-off-by: dependabot[bot] <support@github.com>
Co-authored-by: dependabot[bot] <49699333+dependabot[bot]@users.noreply.github.com>
…k and crons (Refs #276) (#290)

* feat(monthly): monthly donations plan A: sign-up, plan view, stop link and crons (Refs #276)

A signed-in donor signs up for a monthly reminder on a give campaign whose
organizer allows it; each month Give issues an ordinary donation with its
own code and VietQR, and nothing is charged (design 4.3.4, D9).

- Organizer: monthly giving toggle (needs an end date) and supporters list.
- Donor: sign-up on the campaign page, plans on /me/contributions with this
  month's QR, edit and stop; plan donations follow the plan QR rule.
- Stop link: /plans/stop (GET asks) and /api/plans/stop (POST and RFC 8058
  one-click), HMAC-signed; List-Unsubscribe on reminder emails.
- Emails and notices: plan_reminder, plan_followup, plan_ended.
- Crons: issue-plan-donations (hourly), plan-notices (every 10 minutes),
  one plan per call with p_after.

Needs DOS/DOS.Me#1824 (#275).

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

* fix(monthly): one deadline per plan cron run; never show a past month for the next code (Refs #276)

Review round 1 on #290:
- P2: the two steps of each plan cron route had their own 45 s budget and
  could exceed maxDuration (60 s); they now share one deadline
  (remainingBudget), and the expiry step waits for the next run when the
  sweep used it up.
- P3: /me/contributions showed a next code for a past month when
  next_period was left behind (campaign suspended, cron down); it now shows
  this month, as the cron issues.
- P3: stale comment in lib/notices about the plan notice payload.

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

* test(monthly): route test for the plan-notices shared deadline; restore vnMonthStart doc (Refs #276)

Review round 2 P3s on #290.

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

* fix(monthly): PO review of #290: Production stop-link secret, stop page and job resilience (Refs #276)

- P2: stop links need GIVE_RATE_LIMIT_SECRET (>= 32 chars) in Production,
  never the service-role key, and log an error without it; previews and
  local runs keep the fallback. GIVE_RATE_LIMIT_SECRET_PREVIOUS is accepted
  when verifying, for a rotation.
- P3: the expired plan donation note promises the new month's code only
  while the plan is active.
- P3: a plan whose call fails is logged and stepped past (three failures in
  a row still stop the run), so it no longer blocks every plan after it.
- P3: /plans/stop shows a stop as done only for a valid token whose plan is
  stopped; the POST redirect keeps the token for that check.

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

* fix(monthly): PO review: plan jobs count failed plans; offer a transfer only with a usable account (Refs #276)

- server/plans/jobs.ts: no more stepping by table row. The database now
  isolates each plan (DOS/DOS.Me#1824 7dbf82e) and answers it as 'failed';
  the run logs and counts it and goes on. Only a failing call (connection,
  timeout) stops the run. No call starts once the shared budget is spent.
- planDonationPayable also honours usable_account, and /me/contributions
  offers "Chuyển khoản tháng này" only when the campaign has a usable
  account, as give.plan_donation_payable now requires.

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

---------

Co-authored-by: Claude Opus 5.5 <noreply@anthropic.com>
…293)

* docs(po): update product-owner-config for CC-PO v2.18.0 parallel POs (Refs #292)

* style(docs): wrap inline code span cleanly for Prettier (Refs #292)

* docs(po): bound #261-#264 exception strictly to DOS/DOS.Me dev migrations (Refs #292)
…tests to DOS.Me CI (#294)

Owner decision 2026-11-21: forgotten local test databases filled the
developer's machine, so Give work no longer starts local containers.
AGENTS.md states the rule and where pgTAP and migration replay run
(GitHub CI on the DOS/DOS.Me PR); QWEN.md and GEMINI.md point to it.
The stale Cursor core rule no longer tells agents to run PostgreSQL in
Docker, and the PO config records AGENTS.md as the agent instructions.

Co-authored-by: Claude Opus 5.5 <noreply@anthropic.com>
* feat(web): add campaign analytics tracking and organizer Thong ke tab

Implements #252 on top of the merged DOS/DOS.Me#1852 RPCs
(give.record_campaign_event and give.get_campaign_analytics):

- Privacy-safe, bot-filtered, same-origin-checked, rate-limited
  POST /api/analytics/event route handler using dbService().rpc
- Client-side view beacon (deduplicated once per Vietnam day per browser)
  and share-click tracking on public campaign pages
- Organizer /me/campaigns/[id] Thống kê tab with 7/30/90-day period
  switcher, KPI summary strip, daily trend visualization, daily breakdown,
  referrer breakdown, empty/error states, and full Vietnamese diacritics
- Unit and integration tests covering bot filtering, same-origin referrer
  stripping, rate limiting, view deduplication, share tracking, auth
  isolation, and analytics UI

Refs #252

* fix(web): harden analytics ingestion bounds, IPv6 rate limit, and halted empty states

Addresses all Important and Minor findings from the independent review:
- Bound POST /api/analytics/event body reading via Content-Length pre-check
  and streaming byte-limit abort (413) before JSON parsing; use exact
  application/json media-type check and drop redundant appOrigin() call
- Canonicalize client IPs via clientAddress (IPv6 /64, ::ffff: IPv4-mapped,
  isIP validation) before ephemeral HMAC hashing, and delete expired Map
  buckets before re-insertion to preserve eviction order
- Narrow proxy.ts matcher exclusion to api/analytics/
- Show neutral halted empty-state copy for suspended/cancelled campaigns
  instead of pre-launch copy; polish vertical rhythm, bar tooltip wording,
  and < 1% referrer share formatting
- Strip multiple trailing dots in host normalization, narrow Yandex bot
  regex, add meta-externalfetcher, and add regression tests

Refs #252
…n links (#297)

* feat(web): public organizer profile /u/[handle], /me editor & campaign links

* fix(web): harden avatar host validation, CRLF bio normalization, canonical /u redirect & focus polish
… public team block (#298)

* feat(web): co-organizers invites, editor workspace guards, team tab & public team block

* fix(web): address independent review findings for #253 co-organizers
…3 review nits (#300)

* docs(campaigns): sync CHANGELOG/README for #250-#253 wave and fix 2 P3 review nits

* docs(changelog): fix final pgTAP assertion counts for #262 and #264

@claude claude Bot left a comment

Copy link
Copy Markdown

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

⚠️ Code review skipped — your organization has no extra usage available to pay for this review.

If your organization's extra usage balance is empty, an organization admin can add extra usage credits at claude.ai/admin-settings/usage. If its monthly spend limit was reached, an admin can raise it on the same page. If neither applies, contact Anthropic support.

Once extra usage is available, someone with write access to this repository can comment @claude review on this pull request to trigger a review.

@vercel

vercel Bot commented Nov 22, 2026

Copy link
Copy Markdown

The latest updates on your projects. Learn more about Vercel for GitHub.

Project Deployment Actions Updated
give Ready Ready Preview Nov 22, 2026 3:39am UTC

Request Review

@coderabbitai

coderabbitai Bot commented Nov 22, 2026

Copy link
Copy Markdown

Important

Review skipped

Too many files!

This PR contains 186 files, which is 86 over the limit of 100.

To get a review, reduce the PR to 100 files or fewer by splitting it into smaller PRs or changing its base branch.

Upgrade to a paid plan to raise the limit.

CodeRabbit couldn't verify your organization's usage billing state, so no usage-priced review was started. Retry after the billing service recovers.

Run configuration

  • Source mode: Auto
  • Repository: Unavailable
  • Branch: Unavailable
  • File: No configuration file from this repository applied
  • Commit: Unavailable
  • Layers: Organization UI
  • Review profile: CHILL
  • Plan: Advanced
  • Run ID: fe689c52-2443-4ef2-931b-0d8f1bd7c102
Commits

Reviewing files that changed from the base of the PR and between 035ceae and c595676.

Files ignored due to path filters: 1

  • pnpm-lock.yaml is excluded by !**/pnpm-lock.yaml
Files selected for processing: 186

  • .cursor/rules/000-core-setup.mdc
  • AGENTS.md
  • CHANGELOG.md
  • GEMINI.md
  • QWEN.md
  • README.md
  • apps/web/.env.example
  • apps/web/next.config.ts
  • apps/web/package.json
  • apps/web/src/app/(public)/donations/[code]/page.test.ts
  • apps/web/src/app/(public)/donations/[code]/page.tsx
  • apps/web/src/app/admin/actions.test.ts
  • apps/web/src/app/admin/actions.ts
  • apps/web/src/app/admin/emails/actions.test.ts
  • apps/web/src/app/admin/emails/actions.ts
  • apps/web/src/app/admin/emails/page.tsx
  • apps/web/src/app/admin/layout.tsx
  • apps/web/src/app/admin/page.test.ts
  • apps/web/src/app/admin/page.tsx
  • apps/web/src/app/admin/reports/actions.test.ts
  • apps/web/src/app/admin/reports/actions.ts
  • apps/web/src/app/admin/reports/comments/actions.test.ts
  • apps/web/src/app/admin/reports/comments/actions.ts
  • apps/web/src/app/admin/reports/comments/page.test.ts
  • apps/web/src/app/admin/reports/comments/page.tsx
  • apps/web/src/app/admin/reports/page.test.ts
  • apps/web/src/app/admin/reports/page.tsx
  • apps/web/src/app/api/analytics/event/route.test.ts
  • apps/web/src/app/api/analytics/event/route.ts
  • apps/web/src/app/api/cron/activate/route.test.ts
  • apps/web/src/app/api/cron/activate/route.ts
  • apps/web/src/app/api/cron/issue-plan-donations/route.test.ts
  • apps/web/src/app/api/cron/issue-plan-donations/route.ts
  • apps/web/src/app/api/cron/plan-notices/route.test.ts
  • apps/web/src/app/api/cron/plan-notices/route.ts
  • apps/web/src/app/api/cron/purge-outbox/route.test.ts
  • apps/web/src/app/api/cron/purge-outbox/route.ts
  • apps/web/src/app/api/cron/send-outbox/route.test.ts
  • apps/web/src/app/api/cron/send-outbox/route.ts
  • apps/web/src/app/api/email/unsubscribe/route.test.ts
  • apps/web/src/app/api/email/unsubscribe/route.ts
  • apps/web/src/app/api/plans/stop/route.test.ts
  • apps/web/src/app/api/plans/stop/route.ts
  • apps/web/src/app/campaigns/[slug]/CampaignComments.tsx
  • apps/web/src/app/campaigns/[slug]/MonthlyForm.tsx
  • apps/web/src/app/campaigns/[slug]/actions.test.ts
  • apps/web/src/app/campaigns/[slug]/actions.ts
  • apps/web/src/app/campaigns/[slug]/comment-actions.test.ts
  • apps/web/src/app/campaigns/[slug]/comment-actions.ts
  • apps/web/src/app/campaigns/[slug]/monthly-actions.test.ts
  • apps/web/src/app/campaigns/[slug]/monthly-actions.ts
  • apps/web/src/app/campaigns/[slug]/page.test.ts
  • apps/web/src/app/campaigns/[slug]/page.tsx
  • apps/web/src/app/email/unsubscribe/page.tsx
  • apps/web/src/app/invites/[token]/actions.test.ts
  • apps/web/src/app/invites/[token]/actions.ts
  • apps/web/src/app/invites/[token]/page.test.ts
  • apps/web/src/app/invites/[token]/page.tsx
  • apps/web/src/app/me/PublicProfileForm.test.ts
  • apps/web/src/app/me/PublicProfileForm.tsx
  • apps/web/src/app/me/_components/MePage.tsx
  • apps/web/src/app/me/actions.test.ts
  • apps/web/src/app/me/actions.ts
  • apps/web/src/app/me/campaigns/[id]/AnalyticsTab.test.ts
  • apps/web/src/app/me/campaigns/[id]/AnalyticsTab.tsx
  • apps/web/src/app/me/campaigns/[id]/CreateInviteForm.test.ts
  • apps/web/src/app/me/campaigns/[id]/CreateInviteForm.tsx
  • apps/web/src/app/me/campaigns/[id]/MonthlySection.test.ts
  • apps/web/src/app/me/campaigns/[id]/MonthlySection.tsx
  • apps/web/src/app/me/campaigns/[id]/TeamTab.tsx
  • apps/web/src/app/me/campaigns/[id]/fulfillment/actions.test.ts
  • apps/web/src/app/me/campaigns/[id]/fulfillment/actions.ts
  • apps/web/src/app/me/campaigns/[id]/page.test.ts
  • apps/web/src/app/me/campaigns/[id]/page.tsx
  • apps/web/src/app/me/campaigns/actions.test.ts
  • apps/web/src/app/me/campaigns/actions.ts
  • apps/web/src/app/me/campaigns/member-actions.test.ts
  • apps/web/src/app/me/campaigns/member-actions.ts
  • apps/web/src/app/me/campaigns/page.test.ts
  • apps/web/src/app/me/campaigns/page.tsx
  • apps/web/src/app/me/campaigns/reward-actions.test.ts
  • apps/web/src/app/me/campaigns/reward-actions.ts
  • apps/web/src/app/me/contributions/PlanList.tsx
  • apps/web/src/app/me/contributions/actions.test.ts
  • apps/web/src/app/me/contributions/actions.ts
  • apps/web/src/app/me/contributions/page.test.ts
  • apps/web/src/app/me/contributions/page.tsx
  • apps/web/src/app/me/error.tsx
  • apps/web/src/app/me/page.test.ts
  • apps/web/src/app/me/page.tsx
  • apps/web/src/app/media/private/[...path]/route.test.ts
  • apps/web/src/app/media/private/[...path]/route.ts
  • apps/web/src/app/media/public/[...path]/route.test.ts
  • apps/web/src/app/media/public/[...path]/route.ts
  • apps/web/src/app/plans/stop/page.test.ts
  • apps/web/src/app/plans/stop/page.tsx
  • apps/web/src/app/start/actions.test.ts
  • apps/web/src/app/start/actions.ts
  • apps/web/src/app/u/[handle]/not-found.tsx
  • apps/web/src/app/u/[handle]/page.test.ts
  • apps/web/src/app/u/[handle]/page.tsx
  • apps/web/src/components/CampaignCard.test.ts
  • apps/web/src/components/CampaignCard.tsx
  • apps/web/src/components/CopyButton.test.ts
  • apps/web/src/components/Markdown.test.ts
  • apps/web/src/components/OrganizerAvatar.test.ts
  • apps/web/src/components/OrganizerAvatar.tsx
  • apps/web/src/components/ProgressBar.test.ts
  • apps/web/src/components/ShareButtons.test.ts
  • apps/web/src/components/ShareButtons.tsx
  • apps/web/src/components/campaign/CampaignTeam.test.ts
  • apps/web/src/components/campaign/CampaignTeam.tsx
  • apps/web/src/components/campaign/CampaignVideo.test.ts
  • apps/web/src/components/campaign/CampaignVideo.tsx
  • apps/web/src/components/campaign/CampaignViewBeacon.test.ts
  • apps/web/src/components/campaign/CampaignViewBeacon.tsx
  • apps/web/src/components/campaign/MilestoneList.test.ts
  • apps/web/src/components/campaign/MilestoneList.tsx
  • apps/web/src/components/campaign/RecentSupporters.test.ts
  • apps/web/src/components/campaign/RecentSupporters.tsx
  • apps/web/src/components/campaign/StatementPreview.test.ts
  • apps/web/src/components/campaign/StatementPreview.tsx
  • apps/web/src/components/campaign/StatusHistory.test.ts
  • apps/web/src/components/campaign/StatusHistory.tsx
  • apps/web/src/components/layout/SiteHeader.tsx
  • apps/web/src/components/ui/icons.tsx
  • apps/web/src/lib/analytics-client.ts
  • apps/web/src/lib/analytics.test.ts
  • apps/web/src/lib/analytics.ts
  • apps/web/src/lib/campaign-comments.test.ts
  • apps/web/src/lib/campaign-comments.ts
  • apps/web/src/lib/campaign-members.test.ts
  • apps/web/src/lib/campaign-members.ts
  • apps/web/src/lib/campaign-reports.test.ts
  • apps/web/src/lib/campaign-reports.ts
  • apps/web/src/lib/campaigns.test.ts
  • apps/web/src/lib/campaigns.ts
  • apps/web/src/lib/cover-route.test.ts
  • apps/web/src/lib/cover-route.ts
  • apps/web/src/lib/email-outbox.test.ts
  • apps/web/src/lib/email-outbox.ts
  • apps/web/src/lib/errors.test.ts
  • apps/web/src/lib/errors.ts
  • apps/web/src/lib/home.test.ts
  • apps/web/src/lib/home.ts
  • apps/web/src/lib/media.test.ts
  • apps/web/src/lib/media.ts
  • apps/web/src/lib/notices.test.ts
  • apps/web/src/lib/notices.ts
  • apps/web/src/lib/organizer-handle.test.ts
  • apps/web/src/lib/organizer-handle.ts
  • apps/web/src/lib/organizer-profile.test.ts
  • apps/web/src/lib/organizer-profile.ts
  • apps/web/src/lib/plans.test.ts
  • apps/web/src/lib/plans.ts
  • apps/web/src/lib/reward-tiers.test.ts
  • apps/web/src/lib/reward-tiers.ts
  • apps/web/src/lib/validation.ts
  • apps/web/src/proxy.ts
  • apps/web/src/server/analytics-rate-limit.test.ts
  • apps/web/src/server/analytics-rate-limit.ts
  • apps/web/src/server/contributions/contributions.test.ts
  • apps/web/src/server/contributions/index.ts
  • apps/web/src/server/email/log-transport.test.ts
  • apps/web/src/server/email/log-transport.ts
  • apps/web/src/server/email/outbox.test.ts
  • apps/web/src/server/email/outbox.ts
  • apps/web/src/server/email/provider.test.ts
  • apps/web/src/server/email/provider.ts
  • apps/web/src/server/email/purge.ts
  • apps/web/src/server/email/smtp.test.ts
  • apps/web/src/server/email/smtp.ts
  • apps/web/src/server/email/templates.test.ts
  • apps/web/src/server/email/templates.ts
  • apps/web/src/server/email/transport.ts
  • apps/web/src/server/plans/jobs.test.ts
  • apps/web/src/server/plans/jobs.ts
  • apps/web/src/server/plans/stop-link.test.ts
  • apps/web/src/server/plans/stop-link.ts
  • apps/web/src/test/next-config.test.ts
  • apps/web/vercel.json
  • docs/Give-Technical-Design.md
  • docs/product-owner-config.md
  • docs/research/recurring-payment-gateways.md
  • docs/research/recurring-step2-outreach.md
  • docs/research/tingee.md

You can disable this status message by setting the reviews.review_status to false in the CodeRabbit configuration file.

  • Autofix · Keep fixing CodeRabbit findings and required CI, and resolving merge conflicts

Thanks for using CodeRabbit! It's free for OSS, and your support helps us grow. If you like it, consider giving us a shout-out.

Share

@JOY

Copy link
Copy Markdown
Contributor Author

PO acceptance: merge at c595676

JOY approved Production promotion step list by popup on 2026-11-22T15:24+07:00 (Step 2 of 3: merge dev -> main to deploy https://give.vn on Vercel).
Verified prerequisite: DOS/DOS.Me#1869 merged to main at 1de1b0b41a7a3759e41d10ef0024fd708a10d71c and Production Supabase (gulptwduchsjcsbndmua) check completed/success at 2026-11-22T08:26:31Z.
Verified live on #301: mergeStateStatus CLEAN, required checks Lint & Build all apps green, Vercel Preview green, 0 unresolved threads.

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