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

runJavaScriptAlertPanelWithMessage completion handler not called #12709

Closed
data-sync-user opened this issue Dec 15, 2022 · 9 comments
Closed

Comments

@data-sync-user
Copy link
Collaborator

Sentry report

Completion handler passed to -[Client.BrowserViewController webView:runJavaScriptAlertPanelWithMessage:initiatedByFrame:completionHandler:] was not called

Probably relates to this Xcode trace

!Screen Shot 2022-12-15 at 2.09.03 PM.png|width=1171,height=580!

┆Issue is synchronized with this Jira Task

@data-sync-user
Copy link
Collaborator Author

➤ Laurie Marceau commented:

It seems we need to call the completion handler in the two following codepath on the delegate call runJavaScriptAlertPanelWithMessage:

@data-sync-user
Copy link
Collaborator Author

➤ Laurie Marceau commented:

Has a high occurrence in 108.1, should be fixed as soon as possible.

@data-sync-user
Copy link
Collaborator Author

➤ Laurie Marceau commented:

Had another look, it seems the problem relates to the queueing of JS alerts. When the webview isn’t shown (or there’s something else showing on top) we queue the alert which means the webview completion handler isn’t called right away. I tested in Safari if they do some equivalent of this, and it seems they indeed do some queuing (when you come back to the tab, the JS alert is there).

What I used for test:

JavaScript Alert

Try it

<script> setTimeout(function() { alert("I am an alert box!"); }, 5000); // Delay 5 seconds </script>

@data-sync-user
Copy link
Collaborator Author

➤ Yoana Rios Diaz commented:

Note to QA: The crash was related to Javascript alert being queued on a Tab and not showing once the tab became active again.
STR:

  • Open a website that shows an alert with some delay
  • Switch tab and wait for the delay time (to queue JS Alert)
  • Return to tab with alert

Expected:

  • Queue alerts should be shown when Tab becomes active

Actual:

  • Queue alerts were not showed causing the crash because completionHandler wasn’t called

@data-sync-user
Copy link
Collaborator Author

➤ Simion Basca commented:

Verifying as fix on v110 (27314)

@data-sync-user
Copy link
Collaborator Author

➤ Simion Basca commented:

Re-opening since the fix for this issue has been reverted.

@data-sync-user
Copy link
Collaborator Author

➤ Yoana Rios Diaz commented:

The fix for this ticket https://mozilla-hub.atlassian.net/browse/FXIOS-5787 ( https://mozilla-hub.atlassian.net/browse/FXIOS-5787|smart-link ) should fix the root cause of this crash too

@data-sync-user
Copy link
Collaborator Author

➤ Andrei Bodea commented:

Verified as fixed on v9000 (29995) with iPhone 13 Pro (15.7.1).

As the https://mozilla-hub.atlassian.net/browse/FXIOS-5787 ( https://mozilla-hub.atlassian.net/browse/FXIOS-5787|smart-link ) was verified.

Yoana Rios Diaz I think we can re-open this in case we see again the crash, is this fine by closing it?

@data-sync-user
Copy link
Collaborator Author

➤ Yoana Rios Diaz commented:

Andrei Bodea yes I think we can close it 🤞 and reopen again if the crash returns

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

No branches or pull requests

1 participant