mailship/test
Agent 3e667fe3c6 fix: reschedule cron job when confirmed subscriber changes frequency
When a confirmed subscriber calls PUT /subscription/email with a changed
frequency, db.updateSubscription updates the row but the running CronJob
captured the original frequency in createJob and was never rescheduled.
A subscriber switching daily→weekly kept the daily cadence until restart.

Fix: in actions.ts:registerSubscription, call worker.registerSubscription(sub)
when the subscription is already confirmed, so addJob stops the old job and
creates a new one with the updated frequency.

Changes:
- src/actions.ts: add else branch calling worker.registerSubscription when
  sub.confirmed_at is set
- test/reschedule-on-frequency-change.test.js: new failing-before/passing-after
  test verifying the cron expression is updated after frequency change

Closes mailship-e04
2026-09-10 11:30:56 -04:00
..
integration.sh Make subscription upsert idempotent via PUT 2026-09-03 11:47:21 -04:00
normalize-relay-url.test.js test: add failing test for normalizeRelayUrl(undefined) crash 2026-08-25 09:29:29 -04:00
reschedule-on-frequency-change.test.js fix: reschedule cron job when confirmed subscriber changes frequency 2026-09-10 11:30:56 -04:00
web-ui.test.js fix: guard normalizeRelayUrl against undefined env var 2026-08-24 18:21:00 -04:00