FazBrowse GitHub Viewer | Trending |
URL:
| Home
Tools: [Download Repo ZIP]   [Original HTTPS Page]

fix(modal): parent page invalid hierarchy handling [extended] by vakrilov · Pull Request #5966 · NativeScript/NativeScript · GitHub

fix(modal): parent page invalid hierarchy handling [extended] - #5966

Merged
vakrilov merged 5 commits into
masterfrom
NathanWalker-fix-modal-handling
Jun 20, 2018
Merged

vakrilov merged 5 commits into
masterfrom
NathanWalker-fix-modal-handling

Conversation

Copy link
Copy Markdown
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 assigned vakrilov Jun 19, 2018
ghost added the in progress label Jun 19, 2018
vakrilov changed the title Nathan walker fix modal handling fix(modal): parent page invalid hierarchy handling [extended] Jun 19, 2018

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

vakrilov Jun 19, 2018
edited
Loading

Copy link
Copy Markdown
Contributor Author

Choose a reason for hiding this comment

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

Choose a reason Spam Abuse Off Topic Outdated Duplicate Resolved Low Quality

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 requested a review from ADjenkov June 19, 2018 13:05
ghost assigned manoldonev Jun 19, 2018

Copy link
Copy Markdown
Contributor Author

test

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

lock Bot commented Aug 26, 2019

Copy link
Copy Markdown

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 Bot locked and limited conversation to collaborators Aug 26, 2019
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters. Learn more about bidirectional Unicode characters
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.

5 participants


Back | FazBrowse Home | New Git URL