trpc-query-that-mutates-state-antipattern
tRPC query procedures are contract-defined as idempotent reads. Placing write operations (e.g., notification creation, reminder dispatch) inside a query violates the contract and makes side-effects user-triggered rather than cron-driven. The TaskFlow reminders feature used a query (checkDueTomorrow) to write notifications, meaning reminders only fired when a user manually hit the endpoint — effectively broken for async delivery. Mutations must be mutation procedures; scheduled writes require a real cron job.