Repository navigation
Add body invalidation support for native observation tracking - #33
Draft
piercifani wants to merge 1 commit into
Draft
piercifani wants to merge 1 commit into
piercifani wants to merge 1 commit into
Conversation
trackBodyInvalidation() subscribes the current recompose scope to a fresh, weakly held state and returns an id; invalidateBody(id:) bumps it. Native callers hold only the id, so callbacks that outlive the composition hold no JNI references and stale ids are no-ops. Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
This was referenced Nov 23, 2026
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.
Adds two top-level functions for SkipFuseUI's body observation tracking:
trackBodyInvalidation() -> Intcreates a fresh Compose state, reads it so the current recompose scope subscribes to it, and returns an id.invalidateBody(id:)bumps that state.The native side holds only the
Intid, never a JNI reference. Observation cannot cancel a pendingwithObservationTracking, so its callbacks can outlive the composition by a long time. States are held weakly: Compose keeps a state alive only while some scope still reads it, so a stale id is a no-op. Cleared entries are swept every 1024 registrations.Tests:
testBodyInvalidationIDscovers unique ids and no-op invalidation of fired or unknown ids. The end-to-end coverage is in skip-fuse-ui.Part of https://github.com/orgs/skiptools/discussions/755 (see the comment about
@Observable).Related PRs (release in this order):
🤖 Generated with Claude Code