Skip to content

Fix infinite recomposition in NavigationStackPlayground#81

Merged
marcprux merged 1 commit intoskiptools:mainfrom
dfabulich:navigation-infinite-recomposition
Mar 31, 2026
Merged

Fix infinite recomposition in NavigationStackPlayground#81
marcprux merged 1 commit intoskiptools:mainfrom
dfabulich:navigation-infinite-recomposition

Conversation

@dfabulich
Copy link
Copy Markdown
Contributor

I caught this while working on skiptools/skip-ui#292

Mutating state during init causes infinite recomposition.

Skip Pull Request Checklist:

  • REQUIRED: I have signed the Contributor Agreement
  • REQUIRED: I have tested my change locally with swift test
  • OPTIONAL: I have tested my change on an iOS simulator or device
  • OPTIONAL: I have tested my change on an Android emulator or device

  • AI was used to generate or assist with generating this PR. Please specify below how you used AI to help you, and what steps you have taken to manually verify the changes.

@marcprux
Copy link
Copy Markdown
Member

Seems nasty! What tipped you off? In the past with infinite recomposition bugs, they've always had telltale continuous adb log output, but I don't see anything like that with the Path binding sheet in the Showcase app.

@dfabulich dfabulich mentioned this pull request Mar 31, 2026
5 tasks
@dfabulich
Copy link
Copy Markdown
Contributor Author

dfabulich commented Mar 31, 2026

It was the Compose Testing tests in #83 that found it. In Compose Testing API tests, you call composeTestRule.waitForIdle() a lot. Sure enough, this test never went idle, because of its infinite recomposition. (I added logging to the playground to confirm it, and then logcat went crazy.) Fixing this bug fixed the test.

@marcprux marcprux merged commit e1e2816 into skiptools:main Mar 31, 2026
2 checks passed
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Projects

None yet

Development

Successfully merging this pull request may close these issues.

2 participants