Serverless backend for a SaaS? Test report retries

A customer asks for one CSV and sees two reports after the export worker retries. Replay the same event before your next release and check which file the customer would see.

North and West trays each hold one report numbered R-104. A duplicate hovers above North.

1. Replay the same export

Send the same workspace and job ID twice. We ran two deliveries for North’s R-104 against SQLite. The first saved north/first.csv. The second proposed north/retry.csv and inserted zero rows. A unique (workspace, job) key and ON CONFLICT DO NOTHING preserved the first path. SQLite’s UPSERT reference.

2. Reuse the job ID in another workspace

Send R-104 for West and check both workspaces. West saved west/first.csv. Three deliveries left two result rows. A key on job alone would have dropped West’s report.

North R-104 saves first.csv, then a replay keeps that file. West R-104 saves its own first.csv. Three deliveries leave two results.

Download the three-delivery test and run python3 report-retry-check.py. If a replay changes which file the customer sees, email CodeAustral about your export retry with the two paths.

3. Retry an interrupted upload

Stop your worker after it claims the job, then send the same event again. In our second run, North had a pending row and zero visible results. The retry wrote north/R-104.csv and marked the row ready. The customer would then see one result. Give the upload a stable key and show only ready rows in the report list. AWS Lambda retry and idempotency guidance.

Download the test and swap in your report handler. Compare the final paths the customer can see after a replay. Email CodeAustral about your export retry if your worker creates a second result or leaves the first one pending.