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

fix(view): isLoaded stability improvements by NathanWalker · Pull Request #6187 · NativeScript/NativeScript · GitHub

fix(view): isLoaded stability improvements - #6187

Closed
NathanWalker wants to merge 1 commit into
NativeScript:masterfrom
NathanWalker:fix-suspend-resume-isloaded
Closed

NathanWalker wants to merge 1 commit into
NativeScript:masterfrom
NathanWalker:fix-suspend-resume-isloaded

Conversation

NathanWalker commented Aug 15, 2018 •
edited
Loading

Copy link
Copy Markdown
Contributor

PR Checklist

What is the current behavior?

App's can randomly crash when various bindings update upon resuming an app dependent upon a wide array of possible view setups via developers.

What is the new behavior?

Guards have been added to account for various troubling race conditions.

closes #6179

ghost added the ♥ community PR label Aug 15, 2018
NathanWalker changed the title fix(view): isLoaded handling fix(view): isLoaded stability improvements Aug 15, 2018

Copy link
Copy Markdown
Contributor

test

NathanWalker force-pushed the fix-suspend-resume-isloaded branch 2 times, most recently from cbd5952 to fc253d5 Compare August 17, 2018 22:31
}

if (frame.isLoaded && !page.isLoaded) {
if ((frame && frame.isLoaded) && (page && !page.isLoaded)) {

Copy link
Copy Markdown
Contributor

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

page is used couple of lines above - so no point of guarding it here. If it was undefined the code would have crashed here

This comment was marked as abuse.

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

@vakrilov @NathanaelA I updated the handling to ensure of number of possible errors that could occur due to timing and null/undefined - also added trace handling to ensure the log is notified in event of such conditions.

*/
public onChange(): void {
if (this.view.isLoaded) {
if (this.view && this.view.isLoaded) {

Copy link
Copy Markdown
Contributor

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

What are the cases when you get error here?
The view is passed in the constructor and never changed.
Maybe we should add a check there?

This comment was marked as abuse.

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

That’s exactly right @NathanaelA

Copy link
Copy Markdown
Contributor

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

I'm still struggling to get this one. The view is private and is never set (except from the constructor).
If there is a problem with trying to apply styles on disposed view - this check will do nothing more. The view will be disposed, but its CssState will still hold the reference and so this.view will not be null.

NathanWalker force-pushed the fix-suspend-resume-isloaded branch from 54fd13f to 83a39a1 Compare August 23, 2018 00:30

Copy link
Copy Markdown
Contributor Author

Worth noting I am using these changes in a custom pack of core modules in a current project to solve the issues reported and is working 100% without error with these in place.

Copy link
Copy Markdown
Contributor

We should consider merging this in the release branch.

NathanWalker force-pushed the fix-suspend-resume-isloaded branch from 83a39a1 to 7466ba1 Compare August 29, 2018 00:38

vakrilov commented Sep 11, 2018 •
edited
Loading

Copy link
Copy Markdown
Contributor

Hey @NathanWalker and @NathanaelA. I will cherry pick the commit and open a PR in release, so that we can include it in a patch release.

There are still one change that don't really make sense to me. The one in style-scope.t. I'm trying to understand if you have crash reports related to them - this might require a more thorough investigation and maybe additional fix somewhere else.

The stack trace from #6179 points only to the loadView method in the view-base.ts.

vakrilov commented Sep 11, 2018 •
edited
Loading

Copy link
Copy Markdown
Contributor

Closing in favor of #6255

lock Bot commented Oct 22, 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 Oct 22, 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.

Projects

None yet

Development

Successfully merging this pull request may close these issues.

suspend/resume View: Crash - JS ERROR TypeError: undefined is not an object (evaluating 'view.isLoaded')

6 participants


Back | FazBrowse Home | New Git URL