Skip to content
This repository has been archived by the owner on Jan 30, 2025. It is now read-only.

Commit

Permalink
Remove the child frame check in recalcLifecycle
Browse files Browse the repository at this point in the history
The reason this was in place was due to out of order CDP events.
Before PR #555, there was a slim chance that the root frame would
receive lifecycle events before its child frames. This is now not the
case and we can see after extensive stress tests that the child frame
first receives CDP events and then the root/main frame.
  • Loading branch information
ankur22 committed Nov 8, 2022
1 parent 35108f0 commit fc23666
Showing 1 changed file with 0 additions and 19 deletions.
19 changes: 0 additions & 19 deletions common/frame.go
Original file line number Diff line number Diff line change
Expand Up @@ -200,25 +200,6 @@ func (f *Frame) recalculateLifecycle() {
}
f.lifecycleEventsMu.RUnlock()

// Only consider a life cycle event as fired if it has triggered for all of subtree.
f.childFramesMu.RLock()
{
for child := range f.childFrames {
cf := child.(*Frame)
// a precaution for preventing a deadlock in *Frame.childFramesMu
if cf == f {
continue
}
cf.recalculateLifecycle()
for k := range events {
if !cf.hasSubtreeLifecycleEventFired(k) {
delete(events, k)
}
}
}
}
f.childFramesMu.RUnlock()

// Check if any of the fired events should be considered fired when looking at the entire subtree.
mainFrame := f.manager.MainFrame()
for k := range events {
Expand Down

0 comments on commit fc23666

Please sign in to comment.