I've got an offline FR10 plate-inspection tracker where an old completion can finish the next attempt. Random sleeps occasionally expose it, then I can't get the same order again. I want to pin down which attempt the handler thinks it's finishing, not cure it by waiting longer.
I like Luca's queue, but don't quietly give the fake messages an identity the real interface hasn't promised. You can label them in the test harness to explain their origin without pretending your application can read that label.
The offline jobs already have attempt objects. The callback closes over a shared current-attempt variable instead of the object that scheduled it. So the information exists, then my handler looks elsewhere.
Yes, queued that sequence and B switches to finished as soon as I release A's callback. No controller involved. Mei was right too, the old log printed B's name and disguised where it came from.
That's a properly annoying log. I'd keep the origin in it even after fixing the callback, because otherwise the first duplicate you investigate will look like a fresh completion again. Does abandoning A leave its queued callback alive deliberately, or is cancellation failing as well?
Cancellation can be a separate issue. The handler should still refuse an obsolete completion if it arrives after cancellation was requested; don't make the test disappear just by emptying the queue.
Changed the callback to retain its originating attempt and check whether that attempt is still eligible. Old A is now recorded as ignored; B stays pending until its own callback. The double-A case leaves B's accepted count at zero.
They do now. Saved deterministic tests cover obsolete A, repeated A, valid B and repeated B, with state and accepted count checked independently. That's the offline tracker bug fixed; I haven't inferred anything about live controller event identity from it.