Lena Müller
@lena_mueller • 2 weeks ago
Rewrite a vague customer bug report as a ticket an AI coding agent can work: reproduction steps, quoted evidence, hypotheses and a test-first instruction.
reportcode_contextdo_not_touch{{report}}{{code_context}}{{do_not_touch}}report:
"Hi, since yesterday when I try to download my invoice for August from the billing page it downloads the July one instead. It only happens on my laptop, on my phone it's fine. I'm in Vancouver if that matters. The list shows INV-2026-0831 dated Aug 31, 2026 but the PDF says 'Invoice period: July 2026'. Thanks, Priya"
code_context: Billing page is Next.js. The invoice list comes from GET /api/invoices. The download link is built client-side as `/api/invoices/pdf?month=${format(invoice.periodStart, "yyyy-MM")}` using date-fns format(). periodStart is stored as UTC midnight on the 1st of the month.
do_not_touch: the billing-pdf service or the invoices table schemaformat(invoice.periodStart, "yyyy-MM") formats in the browser's timezone. 2026-08-01T00:00:00Z is 31 July, 17:00 in Vancouver, which gives month=2026-07. That fits "July instead of August" and a device-dependent failure. It doesn't explain why the phone works (a different timezone setting? the app rather than the browser?) or "since yesterday"./api/invoices, given "since yesterday". Check the deploys from the past 48 hours.TZ=America/Vancouver and an invoice with periodStart = 2026-08-01T00:00:00Z, and asserts month=2026-08.