mirror of
https://github.com/LightZirconite/Microsoft-Rewards-Bot.git
synced 2026-01-09 17:06:15 +00:00
fix: Update package version to 2.56.13 and improve timeout handling for custom elements registration
This commit is contained in:
4
package-lock.json
generated
4
package-lock.json
generated
@@ -1,12 +1,12 @@
|
||||
{
|
||||
"name": "microsoft-rewards-bot",
|
||||
"version": "2.56.12",
|
||||
"version": "2.56.13",
|
||||
"lockfileVersion": 3,
|
||||
"requires": true,
|
||||
"packages": {
|
||||
"": {
|
||||
"name": "microsoft-rewards-bot",
|
||||
"version": "2.56.12",
|
||||
"version": "2.56.13",
|
||||
"hasInstallScript": true,
|
||||
"license": "CC-BY-NC-SA-4.0",
|
||||
"dependencies": {
|
||||
|
||||
@@ -1,6 +1,6 @@
|
||||
{
|
||||
"name": "microsoft-rewards-bot",
|
||||
"version": "2.56.12",
|
||||
"version": "2.56.13",
|
||||
"description": "Automate Microsoft Rewards points collection",
|
||||
"private": true,
|
||||
"main": "index.js",
|
||||
|
||||
@@ -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++) {
|
||||
|
||||
Reference in New Issue
Block a user