Bind Xamarin.AndroidX.Compose.Foundation MutationInterruptedException#1458
Open
Copilot wants to merge 2 commits into
Open
Bind Xamarin.AndroidX.Compose.Foundation MutationInterruptedException#1458Copilot wants to merge 2 commits into
Copilot wants to merge 2 commits into
Conversation
Co-authored-by: jonathanpeppers <840039+jonathanpeppers@users.noreply.github.com>
Copilot
AI
changed the title
[WIP] Fix MutationInterruptedException binding issue in Xamarin.AndroidX.Compose.Foundation
Bind Xamarin.AndroidX.Compose.Foundation MutationInterruptedException
Jun 7, 2026
There was a problem hiding this comment.
Pull request overview
This PR fixes a Compose Foundation binding gap where androidx.compose.foundation.MutationInterruptedException (and its base androidx.compose.foundation.internal.PlatformOptimizedCancellationException) were being dropped due to mis-read Kotlin metadata visibility, preventing C# consumers from catching the exception by type.
Changes:
- Forces both exception types’
visibilitytopublicviafoundation-androidMetadata.xmlso they are emitted by the generator. - Updates
PublicAPI.Unshipped.txtto reflect the newly surfaced public surface area. - Bumps the NuGet revision for the
Xamarin.AndroidX.Compose.Foundationand.Androidpackages to publish the binding change.
Reviewed changes
Copilot reviewed 3 out of 3 changed files in this pull request and generated no comments.
| File | Description |
|---|---|
source/androidx.compose.foundation/foundation-android/Transforms/Metadata.xml |
Adds visibility=public overrides for the two Compose exception classes so they bind and can be caught from C#. |
source/androidx.compose.foundation/foundation-android/PublicAPI/PublicAPI.Unshipped.txt |
Records the newly exposed exception types/constructors/overrides in the public API tracking file. |
config.json |
Bumps NuGet revision to ship the restored API surface. |
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.
androidx.compose.foundation.MutationInterruptedException— the exception Compose throws into await-able state-mutation APIs (e.g.ScrollState.animateScrollTo,LazyListState.animateScrollToItem) when a higher-priorityMutatorMutexcaller wins mid-flight — was silently dropped during binding, forcing C# callers to over-catch withJava.Lang.Throwable.Root cause
Although both
MutationInterruptedException(public final) and its parentinternal.PlatformOptimizedCancellationException(public abstract) are public in the JAR,class-parsemisreads the Kotlin metadata and emitsvisibility="private"for both, so the generator drops them. The parent was never bound either (only its_jvmAndAndroidKthelper), leaving the subclass without a chainable base type.Changes
foundation-android/Transforms/Metadata.xml: add<attr name="visibility">public</attr>for bothMutationInterruptedExceptionandinternal.PlatformOptimizedCancellationException, restoring the parent base type so the subclass binds naturally.PublicAPI.Unshipped.txt: add the surfaced types/members (parent class + 4 ctors, child class + ctor, and theiroverrideaccessors).config.json: bumpXamarin.AndroidX.Compose.Foundation/.AndroidnugetVersion1.11.2.1→1.11.2.2.Both target namespaces already exist in
published-namespaces.txt, so no namespace changes were needed.This lets callers catch the exception by type: