This repository was archived by the owner on Jan 30, 2025. It is now read-only.
File tree Expand file tree Collapse file tree 1 file changed +17
-10
lines changed Expand file tree Collapse file tree 1 file changed +17
-10
lines changed Original file line number Diff line number Diff line change @@ -663,18 +663,25 @@ func (fs *FrameSession) onExecutionContextCreated(event *cdpruntime.EventExecuti
663
663
if err := json .Unmarshal (auxData , & i ); err != nil {
664
664
k6ext .Panic (fs .ctx , "unmarshaling executionContextCreated event JSON: %w" , err )
665
665
}
666
- var world executionWorld
666
+
667
667
frame , ok := fs .manager .getFrameByID (i .FrameID )
668
- if ok {
669
- if i .IsDefault {
670
- world = mainWorld
671
- } else if event .Context .Name == utilityWorldName && ! frame .hasContext (utilityWorld ) {
672
- // In case of multiple sessions to the same target, there's a race between
673
- // connections so we might end up creating multiple isolated worlds.
674
- // We can use either.
675
- world = utilityWorld
676
- }
668
+ if ! ok {
669
+ fs .logger .Debugf ("FrameSession:onExecutionContextCreated:return" ,
670
+ "sid:%v tid:%v ectxid:%d missing frame" ,
671
+ fs .session .ID (), fs .targetID , event .Context .ID )
672
+ return
677
673
}
674
+
675
+ var world executionWorld
676
+ if i .IsDefault {
677
+ world = mainWorld
678
+ } else if event .Context .Name == utilityWorldName && ! frame .hasContext (utilityWorld ) {
679
+ // In case of multiple sessions to the same target, there's a race between
680
+ // connections so we might end up creating multiple isolated worlds.
681
+ // We can use either.
682
+ world = utilityWorld
683
+ }
684
+
678
685
if i .Type == "isolated" {
679
686
fs .isolatedWorlds [event .Context .Name ] = true
680
687
}
You can’t perform that action at this time.
0 commit comments