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 navigationStackCoordinator getting torn down when being reset on … #613

Merged
merged 2 commits into from
Feb 23, 2023

Conversation

stefanceriu
Copy link
Member

…the navigationSplitCoordinator, added unit tests for it

Navigating to rooms in split mode is currently broken. This happens because we set the detailNavigationStackCoordinator multiple times as the splitCoordinator's detail. This in turn make the splitCoordinator tear down its previous detail which just happens to be the same as the current one. As the detail is a navigationStack that makes it reset itself and release all coordinators

As Coordinators are not currently equatable there's no good way to prevent this on the navigation coordinators level so instead we check against resetting that detail multiple times to the same instance

…the navigationSplitCoordinator, added unit tests for it
@github-actions
Copy link

github-actions bot commented Feb 23, 2023

Warnings
⚠️ Some of the commits are missing ticket numbers. Please consinder using them for better tracking.

Generated by 🚫 Danger Swift against d881665

@stefanceriu stefanceriu force-pushed the stefan/splitLayoutNavigationFix branch from 739be5a to a7f87e8 Compare February 23, 2023 08:38
@Velin92
Copy link
Member

Velin92 commented Feb 23, 2023

More of a question: why we can't just compare the references of the two coordinators by using the === operator? There is a case where even if they are two different coordinators they could still be considered the same coordinator according to some specific internal state?

Copy link
Member

@pixlwave pixlwave left a comment

Choose a reason for hiding this comment

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

LGTM 🚀

@stefanceriu
Copy link
Member Author

why we can't just compare the references of the two coordinators by using the === operator

That's a very very good idea 👏 I'm going to give it a shot

@sonarqubecloud
Copy link

Kudos, SonarCloud Quality Gate passed!    Quality Gate passed

Bug A 0 Bugs
Vulnerability A 0 Vulnerabilities
Security Hotspot A 0 Security Hotspots
Code Smell A 1 Code Smell

No Coverage information No Coverage information
0.0% 0.0% Duplication

@stefanceriu stefanceriu enabled auto-merge (squash) February 23, 2023 14:01
@stefanceriu stefanceriu disabled auto-merge February 23, 2023 14:01
@stefanceriu stefanceriu merged commit ad06e81 into develop Feb 23, 2023
@stefanceriu stefanceriu deleted the stefan/splitLayoutNavigationFix branch February 23, 2023 14:01
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

Successfully merging this pull request may close these issues.

3 participants