@open-wa/wa-automate 4.66.0 → 4.66.3

Sign up to get free protection for your applications and to get access to all the features.
@@ -231,6 +231,16 @@ function create(config = {}) {
231
231
  // eslint-disable-next-line @typescript-eslint/no-unused-vars
232
232
  spinner.succeed('Use this easy pre-filled link to report an issue: ' + (0, tools_1.generateGHIssueLink)(config, debugInfo));
233
233
  spinner.info(`Time to injection: ${((0, tools_1.now)() - browserLaunchedTs).toFixed(0)}ms`);
234
+ /**
235
+ * Atempt to avoid invariant violations
236
+ */
237
+ const invariantAviodanceTs = (0, tools_1.now)();
238
+ yield Promise.race([
239
+ waPage.waitForFunction(`(()=>{if(!window.webpackChunkwhatsapp_web_client && window.webpackChunkwhatsapp_web_client.length) return false; return window.webpackChunkwhatsapp_web_client.length > 15})()`, { timeout: 10000 }).catch(() => { }),
240
+ waPage.waitForFunction(`[...document.getElementsByTagName('div')].filter(x=>x.dataset && x.dataset.testid)[0]?.dataset?.testid === 'qrcode'`, { timeout: 10000 }).catch(() => { }),
241
+ waPage.waitForFunction(`document.getElementsByTagName('circle').length===1`, { timeout: 10000 }).catch(() => { }) //qr spinner is present
242
+ ]);
243
+ spinner.info(`Invariant Violation Avoidance: ${((0, tools_1.now)() - invariantAviodanceTs).toFixed(0)}ms`);
234
244
  if (canInjectEarly) {
235
245
  if (attemptingReauth)
236
246
  yield waPage.evaluate(`window.Store = {"Msg": true}`);
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "@open-wa/wa-automate",
3
- "version": "4.66.0",
3
+ "version": "4.66.3",
4
4
  "licenseCheckUrl": "https://funcs.openwa.dev/license-check",
5
5
  "brokenMethodReportUrl": "https://funcs.openwa.dev/report-bm",
6
6
  "patches": "https://cdn.openwa.dev/patches.json",
@@ -105,7 +105,7 @@
105
105
  },
106
106
  "dependencies": {
107
107
  "@brillout/import": "^0.2.1",
108
- "@discordjs/collection": "^1.5.1",
108
+ "@discordjs/collection": "0.8.0",
109
109
  "@open-wa/wa-automate-socket-client": "*",
110
110
  "@open-wa/wa-decrypt": "^4.3.1",
111
111
  "atob": "^2.1.2",
@@ -182,5 +182,8 @@
182
182
  "winston-daily-rotate-file": "^4.5.5",
183
183
  "winston-syslog": "^2.5.0",
184
184
  "xmlbuilder2": "^3.0.2"
185
+ },
186
+ "overrides": {
187
+ "uuid": "^9.0.0"
185
188
  }
186
189
  }