@skrillex1224/android-toolkit 1.0.5 → 1.0.6
This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
- package/dist/index.cjs +18 -2
- package/dist/index.cjs.map +2 -2
- package/dist/index.js +18 -2
- package/dist/index.js.map +2 -2
- package/package.json +1 -1
package/dist/index.js
CHANGED
|
@@ -1323,8 +1323,24 @@ async function waitForStable(ctx, selectors, options = {}) {
|
|
|
1323
1323
|
let stableSince = 0;
|
|
1324
1324
|
let mutationCount = 0;
|
|
1325
1325
|
let wasPaused = false;
|
|
1326
|
+
let snapshotErrorCount = 0;
|
|
1327
|
+
let lastSnapshotError = null;
|
|
1326
1328
|
while (Date.now() < deadline) {
|
|
1327
|
-
const snapshot2 = await captureSnapshot(ctx, selectorList, options)
|
|
1329
|
+
const snapshot2 = await captureSnapshot(ctx, selectorList, options).catch((error) => {
|
|
1330
|
+
snapshotErrorCount += 1;
|
|
1331
|
+
lastSnapshotError = error;
|
|
1332
|
+
if (snapshotErrorCount === 1 || snapshotErrorCount % 5 === 0) {
|
|
1333
|
+
Logger.warn("Mutation.waitForStable snapshot skipped", {
|
|
1334
|
+
snapshotErrorCount,
|
|
1335
|
+
message: error?.message || String(error)
|
|
1336
|
+
});
|
|
1337
|
+
}
|
|
1338
|
+
return null;
|
|
1339
|
+
});
|
|
1340
|
+
if (!snapshot2) {
|
|
1341
|
+
await sleep(pollIntervalMs);
|
|
1342
|
+
continue;
|
|
1343
|
+
}
|
|
1328
1344
|
if (!foundInitial) {
|
|
1329
1345
|
if (snapshot2.found || Date.now() >= initialDeadline) {
|
|
1330
1346
|
foundInitial = true;
|
|
@@ -1372,7 +1388,7 @@ async function waitForStable(ctx, selectors, options = {}) {
|
|
|
1372
1388
|
}
|
|
1373
1389
|
await sleep(pollIntervalMs);
|
|
1374
1390
|
}
|
|
1375
|
-
throw new Error(`Mutation.waitForStable \u8D85\u65F6 (${timeout}ms), \u5DF2\u68C0\u6D4B\u5230 ${mutationCount} \u6B21\u53D8\u5316`);
|
|
1391
|
+
throw new Error(`Mutation.waitForStable \u8D85\u65F6 (${timeout}ms), \u5DF2\u68C0\u6D4B\u5230 ${mutationCount} \u6B21\u53D8\u5316, snapshotErrorCount=${snapshotErrorCount}, lastSnapshotError=${lastSnapshotError?.message || ""}`);
|
|
1376
1392
|
}
|
|
1377
1393
|
async function waitForStableAcrossRoots(ctx, selectors, options = {}) {
|
|
1378
1394
|
return waitForStable(ctx, selectors, options);
|