Grep your library before the framework-free rewrite
I assumed my Next.js logger was stuffed with React. One grep said 3 files out of 36. A second grep found two more that import nothing at all.
6 posts
I assumed my Next.js logger was stuffed with React. One grep said 3 files out of 36. A second grep found two more that import nothing at all.
Two reconnect attempts overlap, the slow one finishes last, and your client now trusts a socket that is already gone. ioredis stops this with a single counter. Here is the race, in 30 lines you can run.
A loop of awaited fetch() calls to one host keeps exactly two sockets open. I measured why, and the one-line change that drops it to one.
p-queue leaves dequeued items in place and moves a head pointer instead. I measured the difference: shift() took 3.5s where the pointer took 2.6ms.
I built a fake Postgres server to watch postgres.js on the wire. Ten queries left in one packet — but the first run of each one always waits alone.
A 5-per-300ms rate limit let 9 calls through in a 30 millisecond span. Not a bug — the default window type. Here is what I measured, why it happens, and the one option that fixes it.