Two Invoices, One Number: Allocate Invoice Numbers From the Log, Not a Cell
A second click on the menu item is enough to send two PDFs under INV-2026-0042. The fix is to let the log hand out the number, and to write the row before anything leaves.

Search for a command to run...
Articles tagged with #javascript
A second click on the menu item is enough to send two PDFs under INV-2026-0042. The fix is to let the log hand out the number, and to write the row before anything leaves.

Date-versioned rules, an entry id derived from the facts, and an append-only ledger: the Apps Script pattern that turns a recompute into a no-op.

CacheService caps out at six hours and can drop entries before they expire. This is the session design that survives both, with the code and the assertions behind it.

Owning the source and owning the running system are different things. Four of the five facts that decide it are not in the code you were handed.

The availability math, the read-then-write race that double-books you, and the guards a public web app needs — with the full code.

The four-layer request stack that keeps third-party API calls from silently losing data — exponential backoff, jitter, per-source limits, and a dead-letter queue.
