An old FR5 completion finishes whichever coupon attempt is newest

JackChan1124 · 22 Jun 2026, 22:46 UTC

Reply to discussion
JA
JackChan1124
Offline tracker gives an old completion to the newer attempt. Random sleeps won't reproduce it reliably. How should I control delayed and duplicate events?

11 replies

JU
JuliaAllen0326
Replying to JackChan1124

Can the test inject a chosen event at a chosen state transition? Start the first attempt, retain its completion, start the next through the permitted test sequence, then deliver the old event while the new attempt remains pending. Assert both states before proceeding. That is a defined ordering, not a race you hope to win by sleeping longer.

16 points
JA
JackChan1124
Replying to JuliaAllen0326

Yes. The handler currently completes the active attempt, regardless of the event's identifier.

2 points
LI
LiamBaker0490
Replying to JackChan1124

Then reproduce that exact error first. Also record what should happen to the old attempt; leaving the new one alone is only half the expected result.

22 points
PR
PriyaAllen0307
Replying to JackChan1124

Does the real completion contain the same attempt identity that your test will supply?

-4 points
JU
JuliaAllen0326
Replying to PriyaAllen0307

Priya's question protects the test from inventing a better interface than the real one. If the identity is absent or ambiguous, the expected behaviour should preserve that uncertainty rather than let the test helper assign it using knowledge the application cannot have.

11 points
JA
JackChan1124
Replying to PriyaAllen0307

The captured events do contain attempt identifiers. The application discards them before choosing the active state.

0 points
LI
LiamBaker0490
Replying to JackChan1124

Jack, has the deterministic sequence reproduced the original failure now? Interested in that before the duplicate and restart cases make the test harder to read.

22 points
JA
JackChan1124
Replying to LiamBaker0490

It reproduces every time. Corrected handler matches by attempt identity; old completion no longer finishes the new one.

7 points
JU
JuliaAllen0326
Replying to JackChan1124

Now deliver a matched completion twice and check the report as well as the attempt state. Also deliver the old result after the newer attempt legitimately finishes. A state machine can look correct while a summary counter still treats every delivered event as another completed coupon.

13 points
JA
JackChan1124
Replying to JuliaAllen0326

Duplicate replay leaves the attempt unchanged but increments the report twice. Separate reporting defect confirmed. Restart persistence still untested.

12 points
LI
LiamBaker0490
Replying to JackChan1124

Worth finding. Keep the two reproduced failures separate so the reporting fix cannot hide a tracker regression. You have a useful test sequence, not a completed reconciliation fix yet.

16 points

Add to the discussion

Welcome to Application Robot

Everyone can read the forum. Sign in or create an account to start a discussion, reply, or upload photos.

Forgot your password?

By creating an account, you agree to our Terms and Conditions and community guidelines. Read our Privacy Policy for how your information is handled.