Skip to content

fix(core): Fix Android navigation crash - #9996

Merged
NathanWalker merged 4 commits into
NativeScript:mainfrom
dgmachado:bugfix/android-navigation-crash
Aug 20, 2022
Merged

NathanWalker merged 4 commits into
NativeScript:mainfrom
dgmachado:bugfix/android-navigation-crash

Conversation

@dgmachado

@dgmachado dgmachado commented Aug 17, 2022 •

Copy link
Copy Markdown
Contributor

PR Checklist

What is the current behavior?

Android navigation crash when receiving unexpected value on the Entry struct. The entry.resolvedPage is coming null in a Test App and I suppose the root case is that there's memory leak happening on the navigation.

What is the new behavior?

Fix the Android navigation crash just ignoring the expected value received. It's a defensive programming and that fixes the this crash issue.

@cla-bot cla-bot Bot added the cla: yes label Aug 17, 2022
@CatchABus

CatchABus commented Aug 17, 2022 •

Copy link
Copy Markdown
Contributor

@dgmachado Perhaps, this fix needs more thought. Also, return statement may leave unexpected leftovers.
For instance, entry may still reside in waiting queue, would this be alright? See

@dgmachado

Copy link
Copy Markdown
Contributor Author

@dgmachado Perhaps, this fix needs more thought. Also, return statement may leave unexpected leftovers. For instance, entry may still reside in waiting queue, would this be alright? See

@dgmachado dgmachado closed this Aug 17, 2022
@dgmachado dgmachado reopened this Aug 17, 2022
@dgmachado

Copy link
Copy Markdown
Contributor Author

@dgmachado Perhaps, this fix needs more thought. Also, return statement may leave unexpected leftovers. For instance, entry may still reside in waiting queue, would this be alright? See

@CatchABus good catch. Now I'm updating the arrays completedEntries and waitingQueue properly.

@edusperoni edusperoni left a comment

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.

Looks ok to me. I feel like this issue requires some more thought (how did resolvedPage ever become null? And we care about the frame, not necessarily the page), but this solution is good enough for now.

@NathanWalker
NathanWalker merged commit ca3d9bd into NativeScript:main Aug 20, 2022
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

Projects

None yet

Development

Successfully merging this pull request may close these issues.

4 participants