Skip to content

Commit

Permalink
🚑 fix: 6.41.1 regression mitigated #3080
Browse files Browse the repository at this point in the history
  • Loading branch information
smashah committed Mar 28, 2023
1 parent b586011 commit 7790c4d
Show file tree
Hide file tree
Showing 4 changed files with 16 additions and 7 deletions.
4 changes: 2 additions & 2 deletions src/controllers/auth.ts
Original file line number Diff line number Diff line change
Expand Up @@ -61,8 +61,8 @@ const isTosBlocked = (waPage: Page): Observable<string | boolean> => {

export const waitForRipeSession = async (waPage: Page): Promise<boolean> => {
try {
await waPage.waitForFunction(`window.checkRipeSession()`,
{ timeout: 0, polling: 500 });
await waPage.waitForFunction(`window.isRipeSession()`,
{ timeout: 0, polling: 'mutation' });
return true;
} catch (error) {
return false;
Expand Down
11 changes: 9 additions & 2 deletions src/controllers/init_patch.ts

Large diffs are not rendered by default.

6 changes: 4 additions & 2 deletions src/controllers/initializer.ts
Original file line number Diff line number Diff line change
Expand Up @@ -11,13 +11,13 @@ import { deleteSessionData, initPage, injectApi, kill } from './browser';
import { Spin } from './events'
import { integrityCheck, checkWAPIHash } from './launch_checks';
import CFonts from 'cfonts';
import { generateGHIssueLink, getConfigFromProcessEnv, now } from '../utils/tools';
import { generateGHIssueLink, getConfigFromProcessEnv, now, timePromise } from '../utils/tools';
import { SessionInfo } from '../api/model/sessionInfo';
import { Page } from 'puppeteer';
import { createHash } from 'crypto';
import { readJsonSync } from 'fs-extra'
import { upload } from 'pico-s3';
import { injectInitPatch } from './init_patch'
import { injectInitPatch, injectInternalEventHandler } from './init_patch'
import { earlyInjectionCheck, getLicense, getPatch, getAndInjectLivePatch, getAndInjectLicense } from './patch_manager';
import { log, setupLogging } from '../logging/logging';

Expand Down Expand Up @@ -285,6 +285,8 @@ export async function create(config: AdvancedConfig | ConfigObject = {}): Promis
spinner.emit('successfulScan');
spinner.succeed();
}
const tI = await timePromise(()=> injectInternalEventHandler(waPage))
log.info(`Injected internal event handler: ${tI} ms`)
if(attemptingReauth) {
await waPage.evaluate("window.Store = undefined")
if(config?.waitForRipeSession) {
Expand Down
2 changes: 1 addition & 1 deletion src/lib/launch.js

Large diffs are not rendered by default.

0 comments on commit 7790c4d

Please sign in to comment.