Skip to content

Commit

Permalink
fix(inspector): await inspector init to avoid races (#5829)
Browse files Browse the repository at this point in the history
  • Loading branch information
pavelfeldman authored Mar 16, 2021
1 parent 8565e72 commit c2db8da
Showing 1 changed file with 2 additions and 2 deletions.
4 changes: 2 additions & 2 deletions src/server/supplements/inspectorController.ts
Original file line number Diff line number Diff line change
Expand Up @@ -25,7 +25,7 @@ export class InspectorController implements InstrumentationListener {

async onContextCreated(context: BrowserContext): Promise<void> {
if (isDebugMode())
RecorderSupplement.getOrCreate(context, { pauseOnNextStatement: true });
await RecorderSupplement.getOrCreate(context, { pauseOnNextStatement: true });
}

async onBeforeCall(sdkObject: SdkObject, metadata: CallMetadata): Promise<void> {
Expand Down Expand Up @@ -53,7 +53,7 @@ export class InspectorController implements InstrumentationListener {
}

if (shouldOpenInspector(sdkObject, metadata))
RecorderSupplement.getOrCreate(context, { pauseOnNextStatement: true });
await RecorderSupplement.getOrCreate(context, { pauseOnNextStatement: true });

const recorder = await RecorderSupplement.getNoCreate(context);
await recorder?.onBeforeCall(sdkObject, metadata);
Expand Down

0 comments on commit c2db8da

Please sign in to comment.