mailship/test
mplorentz 34c5e28fd1
All checks were successful
CI / checks (pull_request) Successful in 41s
Rate-limit confirmation emails and restore daily/weekly digest cron
- Add last_confirm_sent_at to subscriptions, with a migration for
  existing databases. registerSubscription now sends at most one
  confirmation email per 10 minutes per subscription, so a page-refresh
  or client retry storm can't spam an inbox. The cooldown resets when
  the address changes or a tombstoned row is reactivated (fresh key),
  so genuinely new addresses always get an email immediately.
- Restore getCronExpression to the documented daily (17:00 UTC) and
  weekly (Monday 17:00 UTC) schedules with the 6-field cron syntax the
  cron package expects, fixing the pre-existing reschedule tests that the
  'run every minute' testing hack had broken.
- Add confirm-email-cooldown.test.ts covering first send, refresh storms,
  frequency changes, email changes, reactivation, and the 10-minute constant.

(cherry picked from commit 051c1e88fb)
2026-09-23 12:14:28 -04:00
..
confirm-already-confirmed.test.ts fix: distinguish already-confirmed tokens from invalid ones; prevent duplicate active subscriptions 2026-09-17 16:57:30 -04:00
confirm-code-on-email-change.test.ts Re-activate tomstoned subscriptions when email is the same 2026-09-23 12:12:51 -04:00
confirm-email-cooldown.test.ts Rate-limit confirmation emails and restore daily/weekly digest cron 2026-09-23 12:14:28 -04:00
cors.test.sh fix: scope CORS to browser routes only, require CORS_ORIGIN (fail closed) 2026-09-10 11:29:18 -04:00
digest-reply-stats.test.ts digest email: replace reply/reaction counts with relay URL 2026-09-22 10:04:35 -04:00
digest-template.test.ts Standardize tests on vitest 2026-09-14 13:32:19 -04:00
duplicate-subscription.test.ts fix: distinguish already-confirmed tokens from invalid ones; prevent duplicate active subscriptions 2026-09-17 16:57:30 -04:00
event-arrival-race.test.ts fix: distinguish already-confirmed tokens from invalid ones; prevent duplicate active subscriptions 2026-09-17 16:57:30 -04:00
integration.sh Re-activate tomstoned subscriptions when email is the same 2026-09-23 12:12:51 -04:00
normalize-relay-url.test.ts Standardize tests on vitest 2026-09-14 13:32:19 -04:00
notify-non-wss-relay-crash.test.ts fix: validate relay URL before calling load() and soften unhandledRejection handler 2026-09-18 10:39:04 -04:00
notify-response-shape.test.ts fix: distinguish already-confirmed tokens from invalid ones; prevent duplicate active subscriptions 2026-09-17 16:57:30 -04:00
reschedule-on-frequency-change.test.ts fix: distinguish already-confirmed tokens from invalid ones; prevent duplicate active subscriptions 2026-09-17 16:57:30 -04:00
resubscribe-reactivates.test.ts fix reactivating old rows 2026-09-23 12:13:09 -04:00
schedule-fields.test.ts feat: allow users to choose digest schedule (hour, minute, dayOfWeek, timezone) 2026-09-23 10:50:04 -04:00
setup.ts Standardize tests on vitest 2026-09-14 13:32:19 -04:00