AuthEvery test passed. Users still got logged out.
Two actors rotating the same refresh token, plus a redirect loop between two hosts with separate cookie jars. Each half was correct alone, so the fix was a composition test that runs the whole flow.
"Random logouts" took four pull requests over three weeks, and every one of them shipped with a green test suite. The first cause was two actors rotating the same refresh token: the web app and a background request each thought they were the only one refreshing, so one of them always ended up holding a token the server had just retired. The second cause only showed up in production, where the app lives on two hosts with separate cookie jars: a redirect between them bounced the browser back and forth until the session looked invalid.
Each half was correct on its own, which is exactly why the unit tests passed. The fix that finally held was a composition test that runs the whole login, refresh and redirect flow across both hosts the way a real browser does. The lesson: test the seam, not the pieces, because the bug lives where two correct things meet.
TimezonesSubmitted before it was assigned
Two-thirds of submitted tasks showed a submit time earlier than their assignment. Organisations defaulted to UTC and the board sliced the time off an ISO string. Fixed with one date-logic file and a data fix shipped inside the migration.
A customer noticed that tasks on their board were "submitted" hours before anyone had been assigned to them. About two-thirds of all submitted tasks had the same impossible order. Two defaults had combined: new organisations were created in UTC rather than their own timezone, and the board took an ISO timestamp and sliced the time off to get a date. In India, that moves a late-evening submission to the previous day.
The fix was one small date module with one rule, "a due date is a calendar date, not an instant", and a conversion that always goes through the organisation's own timezone. Every screen and reminder reads dates through that module now. The historical rows were corrected by a data fix shipped inside the same migration, so the code and the data changed together.
QueuesThe recurring job that quietly ran twice a day
A timezone change left the old BullMQ repeat running next to the new one. Now the scheduler is keyed by template id and reconciles queue state against the database at boot.
Recurring work in TaskTap ("payroll on the 1st", "standup every weekday at 9:30") is created by BullMQ repeat jobs. When an organisation changed its timezone, the schedule was re-registered with the new time, but the old repeat kept running too, because a repeat job's key cannot be addressed once it is created. For weeks that organisation got each recurring task twice a day.
The scheduler is now keyed by the recurring template's id, so there can only be one live schedule per template, and at boot the worker reconciles what the queue thinks is scheduled against what the database says should exist. The same review caught a cousin bug: a reminder re-enqueued after a restart could be delivered, and charged for, twice. Reminders are now only rescheduled when the task is more than a day away.
PaymentsRazorpay UPI Autopay cannot be updated
Seat changes need a replacement subscription for UPI and an in-place update for cards. Prorated top-ups are idempotent on the payment id, so a retry never charges twice.
TaskTap bills per seat. With a card subscription, Razorpay lets you update the amount in place. With a UPI Autopay mandate it does not: the mandate is fixed at the amount the customer approved, so changing seats means creating a replacement subscription and retiring the old one at the right moment. The billing code had assumed every subscription could be edited the same way, which worked for every test customer and failed for the first real one on UPI.
The billing flow now branches on the payment method, and the UPI case is handled with a replacement subscription that starts exactly when the old one ends. Prorated top-ups for seats added mid-cycle are keyed on the payment id, so a retried webhook or a double tap can never charge twice.
IntegrationsWhatsApp templates are contracts
Every reminder failed because the code sent en_US and the templates were registered as en. The kill switch now accepts "False", "off" and "no" with a trailing space, because that is what config files contain.
WhatsApp reminders are the feature customers notice first, and one morning every single one failed. The templates had been registered with the language code "en", and the code was sending "en_US". WhatsApp treats template name plus language as a contract, so a mismatch is a message that does not exist. Nothing crashed; the queue just drained into errors.
The template language now comes from one place and is checked when the worker starts. The kill switch accepts "False", "off" and "no" with a trailing space, because those are the values that appear in hand-written config files. And alerts about the WhatsApp worker go out by email, not over WhatsApp, so the alert path never depends on the thing it is alerting about.
CINothing ran the tests before deploy
CI now runs on throwaway Postgres and Redis with a schema-drift check, and a bad deploy is blocked by a failing test rather than noticed by a customer.
For a while TaskTap had tests and a deploy pipeline, and nothing connecting the two. Whether tests had run depended on whether I remembered to run them. The honest fix was to make the machine remember.
CI now brings up a throwaway Postgres and Redis for every run, applies the migrations from scratch, and runs the backend suite against them. A schema-drift check compares the Prisma schema with the migrations, so a model change without a migration fails the build. The deploy job depends on the checks job, which taught me a GitHub Actions lesson: a job name with a hyphen inside an expression parses as subtraction, so the dependency silently never applied until the name changed.