-
Notifications
You must be signed in to change notification settings - Fork 991
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: alerts could freeze the application #1437
Conversation
Codecov ReportAll modified and coverable lines are covered by tests ✅
Additional details and impacted files@@ Coverage Diff @@
## master #1437 +/- ##
=======================================
Coverage 80.22% 80.22%
=======================================
Files 16 16
Lines 1871 1871
=======================================
Hits 1501 1501
Misses 370 370 ☔ View full report in Codecov by Sentry. |
This will still cause issues like not allowing to stack multiple alerts or not showing them if a view controller is present (i.e. InAppBrowser or Camera). |
Closes apacheGH-1120. Closes apacheGH-1121. Closes apacheGH-1429.
7a9b859
to
9cb8f8d
Compare
I did some testing of alert dialogs with this PR while the camera and file pickers were open, and it seemed to work as expected with no freezes. |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
LGTM
I retested the new changes, and they appear to be working as expected.
For example:
- If the camera is open and an alert dialog appears, the user must close the dialog before interacting with or closing the camera capture window.
- When the camera capture window is closed, the app does not freeze and continues to operate as expected.
- Calling multiple system dialogs will not render stack; instead, each dialog will display sequentially, after the previous one is closed.
Platforms affected
iOS
Motivation and Context
Closes GH-1120.
Closes GH-1121.
Closes GH-1429.
Description
In cases where the system was presenting something on the screen (such as a permission prompt, or an undo dialog) or in cases where the
CDVViewController
was not the root view controller (such as in a tabbed navigator), trying to show any dialogs triggered from the WebView would attempt to create an alert on the root view controller and get the view hierarchy into a bad state.Now, we only try to display alerts on the
CDVViewController
that owns the WebView. This means that alerts can potentially end up behind other system dialogs, but the view controller no longer freezes.(As an aside, having access to the
CDVViewController
here will be helpful for some future things too...)Testing
Tested manually by triggering an alert while a permission prompt was being displayed and confirmed that the app continued working as expected.
Checklist