Testing webhook handlers against duplicates, races and out-of-order deliveryMost webhook handlers get tested once: send one event, check for a 200, move on. Production doesn't send one event. Stripe's docs say so. Under Handle duplicate events: "Webhook endpoints might occasi9 min read·quietkernel.hashnode.dev6h ago
I SIGKILLed 160 Node workers to find out which idempotency pattern double-chargesQueues retry. That is their job. BullMQ hands a stalled job to another worker. An agent framework replays a tool call after a timeout. A process dies in the gap between sending the email and writing d7 min read·quietkernel.hashnode.dev11d ago
Building a distributed tokens-per-minute limiter for LLM APIs with one Redis Lua scriptToken buckets, reserve-and-settle leases, crash-safe concurrency slots, and why a 429 isn't always a rate limit7 min read·quietkernel.hashnode.devNov 9
Saved to Postgres, never queued: the transactional outbox for NodeHere's a bug that never shows up in tests. A request saves an order to Postgres, then calls queue.add('send-receipt', ...). The deploy restarts the pod between those two lines, or Redis blips for two9 min read·quietkernel.hashnode.devNov 1
How npm worms steal your credentials, and the order to rotate them inAlmost every npm supply-chain advisory ends with the same instruction: rotate every credential the machine could access. It sounds simple until you try it at 2 AM. Which credentials did the machine ha9 min read·quietkernel.hashnode.dev1DOct 25