Skip to content

fix(manage-space): stop collectors when the view is destroyed - #22787

Merged
mikehardy merged 2 commits into
ankidroid:mainfrom
david-allison:air/main-2-5b75d8ae-b56
Oct 26, 2026
Merged

mikehardy merged 2 commits into
ankidroid:mainfrom
david-allison:air/main-2-5b75d8ae-b56

Conversation

@david-allison

Copy link
Copy Markdown
Member

Note

Assisted-by: GPT-6-Astra xhigh

Purpose / Description

Fixes main category of failures for #22065

Fixes

Approach

launchCollectionInViewLifecycleScope + onViewCreated

How Has This Been Tested?

This fixes a failing test

Checklist

  • You have a descriptive commit message with a short title (first line, max 50 chars).
  • You have commented your code, particularly in hard-to-understand areas
  • You have performed a self-review of your own code
  • UI changes: include screenshots of all affected screens (in particular showing any new or changed strings)
  • UI Changes: You have tested your change using the Google Accessibility Scanner

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 mikehardy left a comment

Copy link
Copy Markdown
Member

Choose a reason for hiding this comment

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

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).

@mikehardy mikehardy added Pending Merge Things with approval that are waiting future merge (e.g. targets a future release, CI wait, etc) and removed Needs Review labels Oct 26, 2026
@mikehardy
mikehardy enabled auto-merge October 26, 2026 16:45
@mikehardy
mikehardy added this pull request to the merge queue Oct 26, 2026
Merged via the queue into ankidroid:main with commit 831f4df Oct 26, 2026
23 checks passed
@github-actions github-actions Bot added this to the 2.26 release milestone Oct 26, 2026
@github-actions github-actions Bot removed the Pending Merge Things with approval that are waiting future merge (e.g. targets a future release, CI wait, etc) label Oct 26, 2026
@david-allison
david-allison deleted the air/main-2-5b75d8ae-b56 branch October 26, 2026 18: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.

2 participants