Skip to content

A spy satellite simulator in your browser, except the data is real. Live open source spatial intelligence on a photorealistic 3D globe.

test: isolate keyed and keyless Traffic browser sessions

Said116f28a52560
diff --git a/changelog.d/1281-traffic-issue-fix.md b/changelog.d/1281-traffic-issue-fix.md
index 2c4d1900c..10dc045d0 100644
--- a/changelog.d/1281-traffic-issue-fix.md
+++ b/changelog.d/1281-traffic-issue-fix.md
@@ -2,3 +2,4 @@
- Exercise current vector road sources and published camera bounds in Traffic fixture QA (asturksever, #1281).
- Establish browser-level foreground visibility for Traffic QA and reject hidden-page samples (asturksever, #1281).
- Supply CORS headers on cross-origin traffic fixtures and report browser exceptions without disabling browser security (asturksever, #1281).
+- Isolate the Traffic keyless browser scenario from the keyed page’s workers and intercepted cache (asturksever, #1281).
diff --git a/scripts/qa-traffic.mjs b/scripts/qa-traffic.mjs
index bb00596ce..d07b7196f 100644
--- a/scripts/qa-traffic.mjs
+++ b/scripts/qa-traffic.mjs
@@ -153,7 +153,7 @@ async function main() {
let exitCode = 0;
try {
- const page = await browser.newPage();
+ let page = await browser.newPage();
// Keep this visible-page regression deterministic even if the OS starts
// Chrome minimized. Use browser focus emulation, not patched DOM getters.
const focusSession = await page.createCDPSession();
@@ -162,7 +162,7 @@ async function main() {
const response = fixtureResponse(request);
if (response) void request.respond(response); else void request.continue();
};
- if (FIXTURES) { await page.setRequestInterception(true); page.on('request', onFixture); }
+ if (FIXTURES) { await page.setCacheEnabled(false); await page.setRequestInterception(true); page.on('request', onFixture); }
await page.setViewport({ width: 1440, height: 900 });
// Track flow-tile requests + traffic console lines for (ii)/(iii)/(v).
@@ -281,7 +281,16 @@ async function main() {
// ── (v) KEYLESS fallback (intercepted — server key untouched) ────────────
console.log('\n(v) KEYLESS — intercepted status, expect pure simulation...');
- if (FIXTURES) page.off('request', onFixture);
+ // Keyless is an independent fresh-session contract. Close the keyed page
+ // so its workers, terrain work and intercepted cache cannot leak into it.
+ await page.close();
+ page = await browser.newPage();
+ await page.setViewport({ width: 1440, height: 900 });
+ const keylessFocus = await page.createCDPSession();
+ await keylessFocus.send('Emulation.setFocusEmulationEnabled', { enabled: true });
+ page.on('pageerror', error => { pageErrors.push(error.message); console.error('PAGE ERROR:', error.message); });
+ page.on('console', message => { if (message.type() === 'error') console.error('BROWSER ERROR:', message.text()); });
+ await page.setCacheEnabled(false);
await page.setRequestInterception(true);
const keylessFlowReqs = [];
page.on('request', (req) => {
@@ -299,7 +308,7 @@ async function main() {
if (response) { void req.respond(response); return; }
try { req.continue(); } catch { /* already handled */ }
});
- await page.reload({ waitUntil: 'domcontentloaded', timeout: 60000 });
+ await page.goto(APP_URL, { waitUntil: 'domcontentloaded', timeout: 60000 });
await page.waitForFunction(
() => window.__godsEyeView?.viewer && window.__godsEyeView?.dataManager,
{ timeout: 60000 },