You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
{{ message }}
Repository navigation
Force a DOM anchor on the navigation and teardown drains #285
The JS drain uses collectorDrainExpression(forceAnchor) so a
freshly injected collector's async anchor is not lost. Python's drain never forces
an anchor, so a navigation destination's DOM can be missed entirely. Scope shrinks
once #284 lands, because the preload removes most of the race; keep this as the
narrow backstop the JS side kept.
Acceptance criteria
The post-navigation and teardown drains force a full-DOM
anchor. A short-lived destination page still anchors. Regression test over the
pure drain payload handling.
This issue anticipated it — "scope shrinks once A6 lands... keep this as the narrow backstop the JS side kept" — so recording what is left.
The navigation half is covered. With the collector registered as a document-start preload, every document instruments itself before any of its own script runs and anchors its own DOM at its own performance.timeOrigin. There is nothing to force, because the anchor is no longer racing an injection. Measured on examples/selenium/python-test/login.py, which visits three documents (/login → /secure → /login):
The one the old path missed is the second visit to /login after logout — a different document with the same URL.
The teardown half is not.collectorDrainExpression(forceAnchor) has no Python equivalent, and the final drain before driver.quit() still never forces an anchor. A page whose document was replaced shortly before teardown can therefore end the run unanchored, and no later command exists to drain it.
Also still open: the preload does not help a session created without webSocketUrl, where the <script> path is the only capture and the original race is intact. That is the case the JS side deliberately kept its backstop for.
Suggested remaining scope: force an anchor on the teardown drain, and on the <script>-path drains when no preload is registered. The navigation-drain half can be dropped.
Activity
vishnuv688 commentedon Aug 18, 2026
Re-scoped after the preload landed (#317)
This issue anticipated it — "scope shrinks once A6 lands... keep this as the narrow backstop the JS side kept" — so recording what is left.
The navigation half is covered. With the collector registered as a document-start preload, every document instruments itself before any of its own script runs and anchors its own DOM at its own
performance.timeOrigin. There is nothing to force, because the anchor is no longer racing an injection. Measured onexamples/selenium/python-test/login.py, which visits three documents (/login→/secure→/login):The one the old path missed is the second visit to
/loginafter logout — a different document with the same URL.The teardown half is not.
collectorDrainExpression(forceAnchor)has no Python equivalent, and the final drain beforedriver.quit()still never forces an anchor. A page whose document was replaced shortly before teardown can therefore end the run unanchored, and no later command exists to drain it.Also still open: the preload does not help a session created without
webSocketUrl, where the<script>path is the only capture and the original race is intact. That is the case the JS side deliberately kept its backstop for.Suggested remaining scope: force an anchor on the teardown drain, and on the
<script>-path drains when no preload is registered. The navigation-drain half can be dropped.