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(modal): parent page invalid hierarchy handling [extended] #5966

Merged
merged 5 commits into from
Jun 20, 2018

Conversation

vakrilov
Copy link
Contributor

Extension of #5841:

  • Added "report error and return immediately logic" _showNativeModalView in _hideNativeModalView
  • getParentWithViewController refactor to be more concise
  • guard in showUIAlertController method

CC @NathanWalker

PR Checklist

What is the current behavior?

Apps break with the current throw without any effective way to handle. Additionally a while loop was being used without safe guards to prevent undefined access.

What is the new behavior?

With tracing on, developers can now properly debug their apps for various use cases without an untested (and most often not reproducible) ux flow/interaction hitting production resulting in this throw leaving the app unstable and unpredictable. Also proper safe guards have been added to prevent undefined access.

@ghost ghost assigned vakrilov Jun 19, 2018
@ghost ghost added the in progress label Jun 19, 2018
@vakrilov vakrilov changed the title Nathan walker fix modal handling fix(modal): parent page invalid hierarchy handling [extended] Jun 19, 2018
@@ -356,6 +364,11 @@ export class View extends ViewCommon {
}

protected _hideNativeModalView(parent: View) {
if (!parent || !parent.viewController) {
traceError("Trying to hide modal view but no parent with viewController specified.")
Copy link
Contributor Author

@vakrilov vakrilov Jun 19, 2018

Choose a reason for hiding this comment

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

It's highly unlikely that the parent is undefined here as it's only called _closeModalCallback where it is scoped. Guard it and viewController prop access anyway.

@vakrilov vakrilov requested a review from ADjenkov June 19, 2018 13:05
@ghost ghost assigned manoldonev Jun 19, 2018
@vakrilov
Copy link
Contributor Author

test

@vakrilov vakrilov merged commit b5b8d51 into master Jun 20, 2018
@vakrilov vakrilov deleted the NathanWalker-fix-modal-handling branch June 20, 2018 13:10
@ghost ghost removed the in progress label Jun 20, 2018
@lock
Copy link

lock bot commented Aug 26, 2019

This thread has been automatically locked since there has not been any recent activity after it was closed. Please open a new issue for related bugs.

@lock lock bot locked and limited conversation to collaborators Aug 26, 2019
Sign up for free to subscribe to this conversation on GitHub. Already have an account? Sign in.
Labels
Projects
None yet
Development

Successfully merging this pull request may close these issues.

None yet

5 participants