Isolate saved state for Android views hosted in Compose - #1560
Merged
steve-the-edwards merged 1 commit intoAug 24, 2026
Conversation
steve-the-edwards
marked this pull request as ready for review
August 18, 2026 18:56
Amp-Thread-ID: https://ampcode.com/threads/T-019fd390-8848-7140-9346-1fa5aa52c4a6 Co-authored-by: Amp <amp@ampcode.com> Co-authored-by: Codex <noreply@openai.com> Ai-assisted: true
steve-the-edwards
force-pushed
the
sedwards/CLF-61/compose-android-view-saved-state
branch
from
August 24, 2026 15:21
539aed3 to
72012c2
Compare
zach-klippenstein
approved these changes
Aug 24, 2026
steve-the-edwards
deleted the
sedwards/CLF-61/compose-android-view-saved-state
branch
August 24, 2026 20:40
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Add this suggestion to a batch that can be applied as a single commit.This suggestion is invalid because no changes were made to the code.Suggestions cannot be applied while the pull request is closed.Suggestions cannot be applied while viewing a subset of changes.Only one suggestion per line can be applied in a batch.Add this suggestion to a batch that can be applied as a single commit.Applying suggestions on deleted lines is not supported.You must change the existing code in this line in order to create a valid suggestion.Outdated suggestions cannot be applied.This suggestion has been applied or marked resolved.Suggestions cannot be applied from pending reviews.Suggestions cannot be applied on multi-line comments.Suggestions cannot be applied while the pull request is queued to merge.Suggestion cannot be applied right now. Please check back later.
Why
ScreenViewFactory.asComposableFactory()bridges a Workflow Android View into Compose. Unlike view-based Workflow containers, the bridge currently gives every hosted View the same parentSavedStateRegistryOwner.Saved-state provider keys must be unique within one registry. Compose may keep outgoing and incoming incompatible
AndroidViews attached simultaneously during replacement, and separate Compose call sites may host sibling Views with the same nested provider keys. Sharing the parent owner therefore allows otherwise independent View trees to collide and crash.What changed
AndroidViewattaches and unregister it when the composition is abandoned or forgotten.Adoption
This is the source-of-truth replacement for consumer-local wrappers that create child
SavedStateRegistryOwners around Android View-backed Workflow renderings in Compose. After adopting a release with this fix, consumers should delete those wrappers and retain their product-level regression tests as downstream verification.Testing
Android instrumentation tests prove that incompatible overlapping Views and sibling Views receive distinct owners, pure Compose retains its parent owner, and Android View state survives Activity recreation.