← Case Studies

The Terminal That Remembered the Wrong Owner

The complaint

A merchant reported that their POS terminal had been placed under a compliance hold for pending verification, despite the merchant having done nothing to trigger one. The hold blocked the terminal from processing transactions entirely. On the surface it looked like an isolated flag, the kind of thing a support ticket and a manual override would resolve in minutes.

Following the swap history

The terminal in question had recently changed hands: it had been retrieved from one agent and reassigned to a new one. Pulling the event history for that terminal showed something odd. The retrieval event, the one responsible for placing the hold, had been processed after the swap event that reassigned the terminal to its new owner. The hold had been correctly triggered, just applied to whoever the system considered the terminal’s owner at the moment it finally got processed, which by then was the new agent, not the one the hold was actually meant for.

The assumption that broke

The retrieval workflow was built on an implicit ordering assumption: a terminal’s retrieval event was expected to fire and finish processing before any subsequent swap event for that same terminal. Under that assumption, resolving “place this hold on the terminal’s current owner” at processing time was safe, since the current owner should still have been the original one. But retrieval and swap were raised by independent processes with no enforced ordering between them. When a swap was processed to completion before its terminal’s overdue retrieval event, the retrieval handler still ran afterward, and it applied the hold to whoever currently held the terminal rather than whoever it was actually about.

Fixing more than the report

Clearing the one merchant’s hold would have resolved the complaint and left the underlying collision live and undetected everywhere else it had already happened. Instead, I audited terminal-swap history across the platform for the same timing signature: any terminal whose retrieval event had been processed after a swap event for that terminal. That signature didn’t depend on a merchant noticing or complaining, it was detectable directly from event ordering alone. The audit surfaced roughly 500 merchants who’d been erroneously held by the same collision, most of whom hadn’t reported anything yet.

The durable fix

The defect wasn’t that retrieval sometimes ran late, it was that the retrieval handler resolved terminal ownership at processing time instead of at the moment the retrieval was actually triggered. The fix bound the retrieval event to the owner identity as of when it was raised, not whoever happened to hold the terminal by the time the event was finally processed, so the outcome became correct regardless of processing order. A monitoring check was added alongside it: any retrieval event processed after a later swap event for the same terminal now surfaces immediately, instead of waiting for the next merchant to notice a hold that shouldn’t be there.

The takeaway

A bug that looks like “the wrong customer got flagged” is often a system trusting an ordering guarantee it never actually enforced. Fixing the reported case protects one merchant. Auditing for the same signature protects the ones who haven’t complained yet. Fixing the ownership-resolution logic itself protects everyone from the next race.