Repository navigation
fix(manage-space): stop collectors when the view is destroyed - #22787
Conversation
Part of 22065 Assisted-by: GPT-6-Astra xhigh
All failures are fixed, no need to skip tests. Part of 22065 Assisted-by: GPT-6-Astra xhigh
mikehardy
left a comment
There was a problem hiding this comment.
Assisted-by: grok-4.7-medium
Thanks — tying the ManageSpace size collectors to the view lifecycle is the right fix for the startup stress REMOVE case.
Local prep: clean rebase (no push; act SHA f80bc73f). Lint (lintAll, ktlintCheck, lint-rules:test), jacocoUnitTestReport, and release emulator tests on API35_GAPI / emulator-5556 passed (authoritative emulator retry; eight XML harness failures waived as ignore-if-present).
ManageSpaceFragment moves the four StateFlow collectors from initSubscreen() into onViewCreated, using launchCollectionInViewLifecycleScope so work stops when the view is destroyed. FragmentLifecycleFixture drops the ManageSpace knownFailures skip so removed before startup coroutines execute exercises that screen again. observeProgress still collects on the activity scope.
GitHub JUnit (macOS/windows) was still pending at review; everything else required was green.
some acceptable findings, no action required, just leaving for posterity: second commit message “all failures fixed” is broader than this slice of #22065 (NoteEditor/CardBrowser cases remain).
Note
Assisted-by: GPT-6-Astra xhigh
Purpose / Description
Fixes main category of failures for #22065
Fixes
Approach
launchCollectionInViewLifecycleScope+onViewCreatedHow Has This Been Tested?
This fixes a failing test
Checklist