Uncategorized

  • Passing a new object as a prop defeats memo

    memo compares props by reference, so an inline object, array or function is a new value on every render and the memo never hits. Passing the id to…

  • Bus::batch, and the completion callback that is not a job

    A batch gives progress and a completion hook for a set of jobs, and the callbacks run on the worker that finished the last one. The callbacks are…

  • A separate hostname is a separate session

    An admin panel on the same hostname as the customer site shares a cookie namespace, a rate limit and a cross-site scripting blast radius. A cookie scoped to…

  • An index hint is a bug report about the optimiser

    Forcing an index makes one query faster today and freezes a decision that the optimiser would otherwise revisit as the data changes. A hint is appropriate as a…

  • Pest is PHPUnit underneath, which is the good news

    The runner, the assertions and the extensions are PHPUnit’s, which means adopting it is a syntax decision rather than a testing-framework migration. Both styles running in one suite…

  • An audit log records reads, not only writes

    For anything with personal or financial data, who looked at it is a question that gets asked, and a write-only audit log cannot answer it. Recording a list…

  • An ignoreErrors entry needs a reason, a baseline entry does not

    A baseline entry is historical debt and needs no justification; an ignore is a claim that the analyser is wrong and does. reportUnmatchedIgnoredErrors is on by default and…

  • Parallel workers need a Redis database each

    A parallel suite gets a database per worker automatically and shares every other backing service, which produces failures that look exactly like ordering bugs. Redis is the one…

  • composer audit reads the same advisories as everything else

    2.4 in August adds an audit command that checks the lock file against the Packagist advisory database, which several separate tools had been doing. Reading the lock file…

  • A read-through cache that stampedes exactly once

    A cache entry expired at 09:00 and four hundred requests recomputed it. A latency spike every hour, exactly on the hour.