fix(web-probe): stabilize switch back navigation
This commit is contained in:
@@ -1033,7 +1033,7 @@ function compactPageProvenance(value) {
|
|||||||
}
|
}
|
||||||
|
|
||||||
function isRetryableNavigationError(message) {
|
function isRetryableNavigationError(message) {
|
||||||
return /net::ERR_NETWORK_CHANGED|net::ERR_ABORTED|net::ERR_CONNECTION_RESET|Navigation timeout|workbench-app-not-ready/iu.test(String(message || ""));
|
return /net::ERR_NETWORK_CHANGED|net::ERR_ABORTED|net::ERR_CONNECTION_RESET|net::ERR_NAME_NOT_RESOLVED|Navigation timeout|workbench-app-not-ready/iu.test(String(message || ""));
|
||||||
}
|
}
|
||||||
|
|
||||||
function navigationFailureKind(message) {
|
function navigationFailureKind(message) {
|
||||||
@@ -1041,6 +1041,7 @@ function navigationFailureKind(message) {
|
|||||||
if (/net::ERR_NETWORK_CHANGED/iu.test(text)) return "net::ERR_NETWORK_CHANGED";
|
if (/net::ERR_NETWORK_CHANGED/iu.test(text)) return "net::ERR_NETWORK_CHANGED";
|
||||||
if (/net::ERR_ABORTED/iu.test(text)) return "net::ERR_ABORTED";
|
if (/net::ERR_ABORTED/iu.test(text)) return "net::ERR_ABORTED";
|
||||||
if (/net::ERR_CONNECTION_RESET/iu.test(text)) return "net::ERR_CONNECTION_RESET";
|
if (/net::ERR_CONNECTION_RESET/iu.test(text)) return "net::ERR_CONNECTION_RESET";
|
||||||
|
if (/net::ERR_NAME_NOT_RESOLVED/iu.test(text)) return "net::ERR_NAME_NOT_RESOLVED";
|
||||||
if (/Navigation timeout/iu.test(text)) return "navigation-timeout";
|
if (/Navigation timeout/iu.test(text)) return "navigation-timeout";
|
||||||
if (/workbench-app-not-ready/iu.test(text)) return "workbench-app-not-ready";
|
if (/workbench-app-not-ready/iu.test(text)) return "workbench-app-not-ready";
|
||||||
return "navigation-error";
|
return "navigation-error";
|
||||||
@@ -1807,7 +1808,13 @@ async function switchAwayAndBack(command) {
|
|||||||
const switchAway = await clickSession(alternateSessionId);
|
const switchAway = await clickSession(alternateSessionId);
|
||||||
const awaySettle = await waitForWorkbenchSessionHydrated(page, alternateSessionId, { timeoutMs: 15000 });
|
const awaySettle = await waitForWorkbenchSessionHydrated(page, alternateSessionId, { timeoutMs: 15000 });
|
||||||
const away = awaySettle.snapshot ?? await workbenchSessionSnapshot();
|
const away = awaySettle.snapshot ?? await workbenchSessionSnapshot();
|
||||||
let switchBack = await gotoTarget("/workbench/sessions/" + encodeURIComponent(canarySessionId));
|
let switchBack;
|
||||||
|
try {
|
||||||
|
switchBack = await clickSession(canarySessionId);
|
||||||
|
} catch (error) {
|
||||||
|
const fallbackNavigation = await gotoTarget("/workbench/sessions/" + encodeURIComponent(canarySessionId));
|
||||||
|
switchBack = { ok: fallbackNavigation?.readiness?.ok === true, fallback: "gotoTarget", clickError: errorSummary(error), navigation: fallbackNavigation, valuesRedacted: true };
|
||||||
|
}
|
||||||
let backSettle = await waitForWorkbenchSessionHydrated(page, canarySessionId, { timeoutMs: 15000 });
|
let backSettle = await waitForWorkbenchSessionHydrated(page, canarySessionId, { timeoutMs: 15000 });
|
||||||
let after = backSettle.snapshot ?? await workbenchSessionSnapshot();
|
let after = backSettle.snapshot ?? await workbenchSessionSnapshot();
|
||||||
let switchBackRecovery = null;
|
let switchBackRecovery = null;
|
||||||
|
|||||||
Reference in New Issue
Block a user