Sample handoff: moving invoice reminders to the job queue
A fictional result of the Hand off recipe: where the work stands, what was decided, open questions, gotchas, and the one next step.
Where it stands
Reminders used to be sent by a cron script. After they went out twice on 14 August, we are moving them onto the job queue so each reminder is sent exactly once. The queue job is written and tested; the old cron script still runs in production.
- Done
- 3 of 5
- steps in the plan
- Branch
- reminders-queue
- 2 commits ahead of main
- Tests
- 41 passing
- none skipped
Decided
- Each reminder gets a unique key (invoice + reminder number), so a retry can never send it twice.
- The cron script is switched off only after the queue has run in production for two days alongside it, in dry-run mode.
Open questions
- Should a reminder that misses its 8am–8pm window wait until the next morning, or be skipped?
- Do we need a backfill for reminders lost during the switch?
Gotchas
- The worker reads time zones from the client, not the freelancer. The tests cover both; don't simplify that away.
- Local Postgres needs
pnpm migrateafter pulling this branch: there is a new table.
Next step
Deploy the queue job in dry-run mode and compare its log with the cron script's for two days.