Skip to content

fix: update flows when screen is visible#20192

Open
david-allison wants to merge 2 commits intoankidroid:mainfrom
david-allison:fix-flow-updates
Open

fix: update flows when screen is visible#20192
david-allison wants to merge 2 commits intoankidroid:mainfrom
david-allison:fix-flow-updates

Conversation

@david-allison
Copy link
Member

Purpose / Description

Knowing what I know now, repeatOnLifecycle(Lifecycle.State.STARTED) is better

Fixes

Approach

  • refactor to use context parameters
  • Change State.RESUMED => State.STARTED

How Has This Been Tested?

Unit tests: 1 fixed - the Robolectric runBlocking workaround wasn't perfect

I went through all seemingly risky functionality using my Pixel 9 Pro - no catastrophic issues.

Learning (optional, can help others)

Robolectric isn't perfect

Cause:

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

to 'Flow.kt' using context parameters
... but not interactive

Cause:
* https://redirect.github.com/ankidroid/Anki-Android/pull/17690#discussion_r1905349394
* => e35b5b9

Knowing what I know now,
`repeatOnLifecycle(Lifecycle.State.STARTED)` is better

Fixes 19632
@david-allison david-allison added this to the 2.24 release milestone Jan 22, 2026
Copy link
Contributor

@criticalAY criticalAY left a comment

Choose a reason for hiding this comment

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

One question rest is all good, will approve once its resolved

@criticalAY criticalAY added Needs Author Reply Waiting for a reply from the original author and removed Needs Review labels Feb 5, 2026
@github-actions

This comment was marked as outdated.

@github-actions github-actions bot added the Stale label Feb 19, 2026
@github-actions github-actions bot closed this Feb 26, 2026
@david-allison david-allison reopened this Mar 3, 2026
@github-actions github-actions bot removed the Stale label Mar 3, 2026
@david-allison david-allison added Needs reviewer reply Waiting for a reply from another reviewer and removed Needs Author Reply Waiting for a reply from the original author labels Mar 4, 2026
Copy link
Contributor

@criticalAY criticalAY left a comment

Choose a reason for hiding this comment

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

Looks good!!, thankyou I have extracted so all cool 👌🏼

@criticalAY criticalAY added Needs Second Approval Has one approval, one more approval to merge and removed Needs reviewer reply Waiting for a reply from another reviewer labels Mar 5, 2026
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

Needs Second Approval Has one approval, one more approval to merge

Projects

None yet

Development

Successfully merging this pull request may close these issues.

Update flows when the screen is visible, but not interactive

2 participants