Skip to content

Change runOnIdle to execute on the UI thread, and to not waitForIdle afterward #1601

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

Merged
merged 2 commits into from
Oct 1, 2024

Conversation

m-sasha
Copy link
Member

@m-sasha m-sasha commented Sep 27, 2024

Our current implementation of runOnIdle does two things differently from Android:

  1. It does not execute on the UI thread.
  2. It includes an additional waitForIdle call after action has returned.

This PR changes that. aligning the behavior with Android.

Testing

Describe how you tested your changes. If possible and needed:

  • Added new unit tests

Release Notes

Breaking Changes - Tests

  • runOnIdle will now execute action on the UI thread aligning the behavior with Android.
  • runOnIdle will no longer call waitForIdle after executing the action aligning the behavior with Android.

@m-sasha m-sasha force-pushed the m-sasha/report-idle-with-delayed-launched-effect branch 3 times, most recently from 4cfc512 to c973fff Compare September 30, 2024 12:48
@m-sasha m-sasha force-pushed the m-sasha/fix-run-on-idle branch from 3cffe4e to 12e5e54 Compare September 30, 2024 12:52
@m-sasha m-sasha force-pushed the m-sasha/report-idle-with-delayed-launched-effect branch from c973fff to 28c3cda Compare September 30, 2024 16:32
Base automatically changed from m-sasha/report-idle-with-delayed-launched-effect to jb-main October 1, 2024 08:43
@m-sasha m-sasha force-pushed the m-sasha/fix-run-on-idle branch from 12e5e54 to 92c71b9 Compare October 1, 2024 08:51
@m-sasha m-sasha requested review from terrakok and eymar October 1, 2024 09:40
Copy link
Member

@eymar eymar left a comment

Choose a reason for hiding this comment

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

LGTM! In the release notes it might be useful for a reader to know that the change aligns the behaviour with android.

@m-sasha
Copy link
Member Author

m-sasha commented Oct 1, 2024

LGTM! In the release notes it might be useful for a reader to know that the change aligns the behaviour with android.

Updated the release notes.

@m-sasha m-sasha merged commit 986fa24 into jb-main Oct 1, 2024
6 checks passed
@m-sasha m-sasha deleted the m-sasha/fix-run-on-idle branch October 1, 2024 12:40
igordmn pushed a commit that referenced this pull request Feb 25, 2025
…le` afterward (#1601)

# Conflicts:
#	compose/ui/ui-test/src/skikoTest/kotlin/androidx/compose/ui/test/TestBasicsTest.kt
#	navigation/navigation-compose/src/commonTest/kotlin/androidx/navigation/compose/NavHostTest.kt
zamulla added a commit to JetBrains/kotlin-multiplatform-dev-docs that referenced this pull request Mar 21, 2025
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