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

Crash while unwrapping coordinator in NavigationRouter #91

Open
Steffenberg opened this issue Aug 24, 2022 · 2 comments
Open

Crash while unwrapping coordinator in NavigationRouter #91

Steffenberg opened this issue Aug 24, 2022 · 2 comments

Comments

@Steffenberg
Copy link

Steffenberg commented Aug 24, 2022

Hello,

I encountered an AppCrash in the "coordinator" getter of NavigationRouter due to the force cast on the type.

When bringing back the App from background I sometimes get:
#6 (null) in swift_dynamicCast ()

I am calling it this way (after unwrapping the router safely):
_ = overviewRouter.coordinator.customPopToRoot()

Stacktrace:

0 (null) in __pthread_kill ()
6 (null) in swift_dynamicCast ()
7 0x000000010325a530 in NavigationRouter.coordinator.getter ()
8 0x0000000102f8d720 in specialized NavService.goToOverviewRoot()
9 0x000000010370ab20 in LifecycleService.reactOnStatusChange()
10 0x000000010370a92c in LifecycleService.updateTo(state:)
11 (null) in protocol witness for LifecycleServiceType.updateTo(state:) in conformance LifecycleService ()
12 0x00000001030183dc in App.handleAppState(_:)
13 (null) in partial apply for closure 2 in closure 1 in App.body.getter ()

Most likely because of the force cast of the weakReference in NavigationRouter.coordinator. Did you ever encounter this problem or have an idea how to solve it (other than making coordinator optional)?

Best regards
Steffen

@Steffenberg Steffenberg changed the title Crash while resolving coordinator from NavigationRouter Crash while unwrapping coordinator in NavigationRouter Aug 24, 2022
@LePips
Copy link
Collaborator

LePips commented Aug 24, 2022

What are you attempting to do? Do you have a small sample to replicate?

@Steffenberg
Copy link
Author

Steffenberg commented Aug 25, 2022

Thank you for your reply

Easily said I just want to go back to the root view on my "OverviewCoordinator" which just has the posibility of showing different child Coordinators. The OverviewCoordinator has a bit of a stage management system, this is why I have the custom "popToRoot"-Method changing the state before executing the navigation.

The thing is that it is embedded in a more complex operation and sample code might be a bit hard to extract but I will try to. Another problem is I was not able to reproduce it myself but our customer had it crashing several times (the log I provided are taken from Testflight directly).

Long story short I will try to provide a sample today/tomorrow, not guaranteeing it can really reproduce it :-/

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

2 participants