fix: Update package version to 2.56.13 and improve timeout handling for custom elements registration

This commit is contained in:
2025-11-13 21:48:59 +01:00
parent 6bf1d6270a
commit c1ab595f25
3 changed files with 12 additions and 6 deletions

View File

@@ -89,11 +89,17 @@ export default class BrowserFunc {
this.bot.log(this.bot.isMobile, 'GO-HOME', `Page took ${readyResult.timeMs}ms to be ready (slow)`, 'warn')
}
// IMPROVED: Wait for Custom Elements to be registered
// IMPROVED: Wait for Custom Elements to be registered with proper timeout handling
// FIXED: Use Promise.race to enforce actual 5s timeout (Playwright's timeout doesn't work with customElements.whenDefined)
try {
await page.evaluate(() => customElements.whenDefined('mee-card-group'), { timeout: 5000 })
await Promise.race([
page.evaluate(() => customElements.whenDefined('mee-card-group')),
new Promise((_, reject) => setTimeout(() => reject(new Error('Custom element timeout')), 5000))
])
} catch (error) {
this.bot.log(this.bot.isMobile, 'GO-HOME', 'mee-card-group custom element not registered within 5s', 'warn')
// FIXED: Silent fallback - custom element registration is best-effort, not critical
// If it times out, we proceed with activities detection anyway
this.bot.log(this.bot.isMobile, 'GO-HOME', 'mee-card-group custom element not registered within 5s (non-critical)', 'log')
}
for (let iteration = 1; iteration <= RETRY_LIMITS.GO_HOME_MAX; iteration++) {