Uncategorized

  • Queue batching, and the callback when the last job finishes

    Knowing when a set of queued jobs had all finished meant a counter in Redis and a race nobody was confident about. allowFailures is the flag that decides…

  • A quoted heredoc delimiter expands nothing

    A heredoc expands variables and command substitutions by default, which is convenient for a template and disastrous for anything containing a dollar sign belonging to another language. One…

  • A self-hosted runner, and what it is allowed to reach

    The hosted runner cannot reach the private network, which is the whole problem — and a runner inside it is a machine running other people’s code.

  • BigInt exists, and JSON does not know about it

    An identifier larger than 2^53 loses precision as a JavaScript number, and BigInt fixes the arithmetic and not the transport. This is the reason well-designed APIs return large…

  • real_ip_from, or the client address is whatever they say

    Behind a proxy, $remote_addr is the proxy — and reading X-Forwarded-For instead is correct only if you also refuse to believe it from anyone but the proxy. This…

  • An index template before the first document

    Field types are decided by whichever document arrives first, so a field that is an integer in one service and a string in another is rejected in the…

  • An SLO is a number somebody agreed to

    Everyone wanted the site to be fast and nobody could say what fast meant. An indicator, an objective and a window — and the error budget is what…

  • A canary needs a metric to decide on, agreed in advance

    A canary release without a decision rule is a slower deploy — somebody watches a dashboard for ten minutes, sees nothing obvious and promotes it. The minimum sample…

  • Read-your-own-writes is a product requirement, not a bug

    A user who submits a form and immediately sees stale data reports it as a bug, and it is a consequence of a decision somebody made about replication.…

  • A PHPStan extension for a magic method

    Frameworks built on __call and facades produce hundreds of findings that are all the same false positive, and putting them in the baseline hides real errors of the…