Video-only Session Rewind versus state restoration after a schema change
0 reputation · 22 Mar 2020, 15:02 UTC
0 reputation · 22 Mar 2020, 15:02 UTC
Teams using BrowserStack Automate want rollback-safe debugging after a server-side schema change and are evaluating Session Rewind as a way to inspect a prior point in a test session.
Session Rewind is documented as a capability to jump to a specific timestamp within a test session's video recording for visual debugging. The UI description covers video playback, while the REST API reference does not expose explicit semantics for restoring browser storage, cookies, localStorage, sessionStorage, DOM or JavaScript state to the rewind point.
The unresolved behavior is whether rewinding affects the live browser context at all, or is limited to video playback. When tests depend on schema-dependent responses, a mismatch between the video timestamp and the current client state can create ambiguity about what is being inspected.
Does Session Rewind restore browser storage and DOM to the selected timestamp, or is playback video-only? If state is not restored, what is the documented contract for state consistency between the video timestamp and the live browser context? Is there a documented approach to guarantee a clean browser context after a schema change when reusing a session?
35275 reputation · 22 Mar 2020, 19:48 UTC
No. Session Rewind in BrowserStack Automate does not restore the browser’s storage, cookies, localStorage, sessionStorage, or the live DOM to the timestamp you jump to. It is a visual‑debugging tool that rewinds the recorded video only.
The contract is straightforward: the video timestamp represents what happened at that moment; the live browser context continues from the point where the test started or where the last reset occurred. There is no guarantee that the DOM or client‑side state matches the video at any given rewind point.
browserstack.sessionReset capability (or the equivalent REST call) to clear cookies, storage, and the DOM.browserstack.sessionReuse: false in your test configuration. This forces a new browser context for each test run.localStorage.clear(); sessionStorage.clear(); document.cookie = "";) to ensure no stale data persists.Use Session Rewind only for visual inspection of where a failure occurred. If you need to interact with the page at that point, first reset the session or start a new one.
To tailor the recommendation further, could you confirm whether your test suite currently enables browserstack.sessionReuse? This flag influences whether you’d need to reset the session after a schema change.
Use comments to ask for clarification. Post a solution as an answer.
35,275 reputation · 22 Mar 2020, 17:39 UTC
It is important to clarify that Session Rewind is a visual debugging tool and does not function as a stateful snapshot or checkpoint system. Rewinding the video playback does not trigger a restoration of the browser's DOM, JavaScript execution context, cookies, or local storage to the selected timestamp.
Because the feature is limited to the video stream, there is no documented contract for state consistency between the video timestamp and the live browser context. If a server-side schema change occurs, rewinding the video will show the UI as it appeared previously, but it cannot revert the client-side state or the server's current response logic.
To verify this behavior in a test environment, you can perform the following check:
localStorage change during a session.