Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Fix frame panic #1542

Merged
merged 1 commit into from
Nov 18, 2024
Merged

Fix frame panic #1542

merged 1 commit into from
Nov 18, 2024

Conversation

ankur22
Copy link
Collaborator

@ankur22 ankur22 commented Nov 18, 2024

What?

The change fixes a panic by returning nil instead of erroring.

Why?

If the frame is nil at this point, then the cause of this is likely due to chrome not sending a frameAttached event ahead of time. This isn't a bug in chrome, and seems to be intended behavior. Instead of worrying about the nil frame and causing the test to fail when the frame is nil, we can instead return early. The frame will be initialized when getFrameTree CDP request is made, which will call onFrameAttached and onFrameNavigated.

Checklist

  • I have performed a self-review of my code
  • I have added tests for my changes
  • I have commented on my code, particularly in hard-to-understand areas

Related PR(s)/Issue(s)

#1500

@ankur22 ankur22 requested a review from a team as a code owner November 18, 2024 13:52
@ankur22 ankur22 requested review from oleiade and olegbespalov and removed request for a team November 18, 2024 13:52
If the frame is nil at this point, then the cause of this is likely
due to chrome not sending a frameAttached event ahead of time. This
isn't a bug in chrome, and seems to be intended behavior. Instead
of worrying about the nil frame and causing the test to fail when
the frame is nil, we can instead return early. The frame will
be initialized when getFrameTree CDP request is made, which will
call onFrameAttached and onFrameNavigated.
Copy link
Member

@inancgumus inancgumus left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

This might make sense as PW also returns similarly.

@ankur22
Copy link
Collaborator Author

ankur22 commented Nov 18, 2024

This might make sense as PW also returns similarly.

I think it's one of those ones where we need to see how it reacts in the wild (on remote runs). I'll start on a deployment soon.

@ankur22 ankur22 merged commit d741e45 into main Nov 18, 2024
23 checks passed
@ankur22 ankur22 deleted the fix/frame-panic branch November 18, 2024 15:32
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

3 participants