Prevent an old asset response from replacing a restarted session
Analysis
By Juliet Ramos, Playable Production Editor — 3 min read
View author profile
Prevent an old asset response from replacing a restarted session. A runnable teaching fixture with synthetic cases, a broken branch, and explicit untested cells.
Restarting a playable while an earlier load is still pending can let stale data overwrite the new session. This fixture tests an explicit generation boundary around accepted results.
This edition is a laboratory fixture. Node and the companion HTML page execute the authored functions against synthetic cases. No physical device panel was run, no ad network reviewed the build, and no campaign result is inferred from a passing test.
What the documentation actually supplies
MDN: stale load is the governing reference for the browser primitive. MDN documents AbortController as a way to abort supported asynchronous operations such as fetch and response-body consumption. Cancellation is useful, but an application must still decide whether a completed result belongs to its current state. The fixture policy around that primitive is ours.
The failure the fixture isolates
The laboratory supplies completed responses tagged with a generation and a current generation value. The corrected branch accepts only current results; the broken branch accepts whichever response arrives last. This models the race without real network traffic and complements, rather than replaces, cancellation in an actual loader.
The broken branch is retained so a producer can see the exact mistake, not only the repaired output.
| Case | Input | Expected (fixed) | Broken output |
|---|---|---|---|
| old response arrives last | `{"current":2,"completed":[{"generation":2,"value":"new"},{"generation":1,"value":"old"}]}` | `"new"` | `"old"` |
| only old response | `{"current":3,"completed":[{"generation":2,"value":"old"}]}` | `"pending"` | `"old"` |
| current response | `{"current":1,"completed":[{"generation":1,"value":"ready"}]}` | `"ready"` | `"ready"` |
All 3 fixed-branch cases matched the spec when executed in Node on 19 September 2026.
What a pass does not prove
A pass proves that a late old-generation response cannot win in the supplied sequence. It does not demonstrate that a real request was cancelled, that all dependent work stops, or that an older response cannot leak resources. Those are additional integration checks for the actual asynchronous pipeline.
Untested cells in this edition: physical devices, host SDKs, network packaging limits, store-opening callbacks, and campaign performance. Those remain empty on purpose.
Next check on a real build
Give each restart or content replacement a generation identifier and capture it when work begins. Abort obsolete requests where supported, then check generation again before committing their results. Release discarded resources and distinguish intentional cancellation from a user-visible load error so a normal restart does not display a misleading failure message.
Open the runnable fixture to re-execute the cases in a browser. Download the case record to keep inputs, expectations and limits with a QA ticket.
Background in the archive: Playable ad device testing matrix and Playable spec sheet before you build. Those guides describe practice; they are not a substitute for this fixture and this check does not recertify their every claim.
Featured
Related posts
measurement
playable ads
·1 min read
Playable completers vs video viewers: downstream payer quality
measurement
playable ads
·3 min read
Stop simulation time while the document is hidden
measurement
playable ads
·3 min read
Fit the whole playable stage inside a narrow viewport
measurement
playable ads
·2 min read
Require both intersection and document visibility before advancing
More from the Measurement desk
measurement
·2 min read
Airbridge adds Amazon Ads as an app measurement channel
measurement
·2 min read
When to freeze a cohort for payback review (and when not to)
measurement
media buying
·1 min read
Using predicted LTV in bids: disclosure checklist for the UA team
measurement
media buying
·1 min read