Tag: correctness
All the articles with the tag "correctness".
Fire-and-forget doesn't survive on Cloudflare Workers
3 min readA view counter returned 204 on every call and never moved. Workers can cancel work still pending after the response unless it is passed to waitUntil.
Your error handler is inside the cache
3 min readA thirty-second backend restart became an hour of 404s, because a try/catch inside a "use cache" function cached the failure as a value.
Idempotent writes don't make side effects idempotent
4 min readMaking an offline-first upsert safe to replay took an afternoon. The streak, points, awards and celebration it triggers each needed their own guard.
Math.floor is not a floor
4 min readFlooring a decimal for an API that wants strings: the obvious version drops a step, the clever one rounds up past the input, and neither throws.