feat: Enhance Step 9 diagnostics and error handling
- Refactor getStatusBadgeEntries to use createStep9Entry for better encapsulation. - Introduce error visual signals detection in createStep9Entry. - Add functions to identify OAuth callback timeout failures and step 9 failure texts. - Update buildStep9StatusDiagnostics to include error visual summaries and handle conflicts between success and failure states. - Implement new tests for step 9 diagnostics, ensuring correct behavior with success badges and error banners. - Remove outdated tests related to step 5 onboarding and redirect race conditions. - Add new tests for auto-run behavior in step 6 restart scenarios.
This commit is contained in:
@@ -202,6 +202,29 @@
|
||||
return null;
|
||||
}
|
||||
|
||||
async function waitForTabComplete(tabId, options = {}) {
|
||||
const { timeoutMs = 15000, retryDelayMs = 300 } = options;
|
||||
const start = Date.now();
|
||||
|
||||
while (Date.now() - start < timeoutMs) {
|
||||
try {
|
||||
const tab = await chrome.tabs.get(tabId);
|
||||
if (tab?.status === 'complete') {
|
||||
return tab;
|
||||
}
|
||||
} catch {
|
||||
return null;
|
||||
}
|
||||
await new Promise((resolve) => setTimeout(resolve, retryDelayMs));
|
||||
}
|
||||
|
||||
try {
|
||||
return await chrome.tabs.get(tabId);
|
||||
} catch {
|
||||
return null;
|
||||
}
|
||||
}
|
||||
|
||||
async function ensureContentScriptReadyOnTab(source, tabId, options = {}) {
|
||||
const {
|
||||
inject = null,
|
||||
@@ -619,6 +642,7 @@
|
||||
sendToContentScriptResilient,
|
||||
sendToMailContentScriptResilient,
|
||||
summarizeMessageResultForDebug,
|
||||
waitForTabComplete,
|
||||
waitForTabUrlFamily,
|
||||
waitForTabUrlMatch,
|
||||
};
|
||||
|
||||
Reference in New Issue
Block a user