Open
Conversation
Codecov Report❌ Patch coverage is Additional details and impacted files@@ Coverage Diff @@
## master #3660 +/- ##
============================================
+ Coverage 66.80% 67.07% +0.26%
- Complexity 1608 1611 +3
============================================
Files 363 363
Lines 8980 8983 +3
Branches 1159 1162 +3
============================================
+ Hits 5999 6025 +26
+ Misses 2332 2306 -26
- Partials 649 652 +3
🚀 New features to boost your workflow:
|
shobhitagarwal1612
requested changes
Apr 10, 2026
Member
shobhitagarwal1612
left a comment
There was a problem hiding this comment.
Can we combine all separate mutable states to a single UiState?
Collaborator
Author
|
@shobhitagarwal1612 fully agree! I've refactored the VM to unify the overall state under |
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 join this conversation on GitHub.
Already have an account?
Sign in to comment
Add this suggestion to a batch that can be applied as a single commit.This suggestion is invalid because no changes were made to the code.Suggestions cannot be applied while the pull request is closed.Suggestions cannot be applied while viewing a subset of changes.Only one suggestion per line can be applied in a batch.Add this suggestion to a batch that can be applied as a single commit.Applying suggestions on deleted lines is not supported.You must change the existing code in this line in order to create a valid suggestion.Outdated suggestions cannot be applied.This suggestion has been applied or marked resolved.Suggestions cannot be applied from pending reviews.Suggestions cannot be applied on multi-line comments.Suggestions cannot be applied while the pull request is queued to merge.Suggestion cannot be applied right now. Please check back later.
Fixes #3407
When downloading 2 offline areas in a row, the app would crash. This is because the
OfflineAreaSelectorViewModelwas annotated with@SharedViewModel, which meant that thenavigateSharedFlow outlived the fragment and, when a newOfflineAreaSelectorFragmentwas created, it reuses the previous VM. Then, on emiting anavigateevent, it was collected twice: the current fragment and the one in the backstack - the one which crashed, because the navigation was already on the home screen.This PR removes the
@SharedViewModelusage from that VM, since it's only used by a single fragment anyway. Additionally, the flow collectors in the fragment were refactored to prevent memory leaks (using the viewlifecycle owner to launch coroutines andrepeatOnLifecycle(Lifecycle.State.STARTED))@shobhitagarwal1612 PTAL?