Skip to content

Commit c2db8da

Browse files
authored
fix(inspector): await inspector init to avoid races (#5829)
1 parent 8565e72 commit c2db8da

File tree

1 file changed

+2
-2
lines changed

1 file changed

+2
-2
lines changed

src/server/supplements/inspectorController.ts

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -25,7 +25,7 @@ export class InspectorController implements InstrumentationListener {
2525

2626
async onContextCreated(context: BrowserContext): Promise<void> {
2727
if (isDebugMode())
28-
RecorderSupplement.getOrCreate(context, { pauseOnNextStatement: true });
28+
await RecorderSupplement.getOrCreate(context, { pauseOnNextStatement: true });
2929
}
3030

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

5555
if (shouldOpenInspector(sdkObject, metadata))
56-
RecorderSupplement.getOrCreate(context, { pauseOnNextStatement: true });
56+
await RecorderSupplement.getOrCreate(context, { pauseOnNextStatement: true });
5757

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

0 commit comments

Comments
 (0)