Skip to content

Test: replacing a descendant recreates the intermediate store and loses its injections (parity with Swift) - #1

Merged
sergihernanz merged 1 commit into
mainfrom
feature/android-divergencia-subchild-state
Nov 23, 2026
Merged

sergihernanz merged 1 commit into
mainfrom
feature/android-divergencia-subchild-state

Conversation

@sergihernanz

Copy link
Copy Markdown
Contributor

Tests only (one file, no production change).

ReplaceDescendantInjectionTest pins the behaviour found while investigating PARITY_AUDIT Issue 21: replacing a grandchild through its parent recreates the middle store (new instance, state carried over, dependencies.inject values lost, defaultTrigger re-fires). Swift Statoscope 3.1.0 behaves the same way, so this is parity, not a gap; the test keeps it from regressing silently.

Related: InQBarna/statoscope#3 (Swift 3.1.0: ancestors' state carries the live subtree; descendants of a recreated subtree fire defaultTrigger, which Kotlin already did).

🤖 Generated with Claude Code

…store, as in Swift

Pins what survives when a root replaces a grandchild by writing through the middle level
(`state.copy(middle = middle.copy(leaf = ...))`): the middle store is recreated (new instance),
its state is carried over, and what it injected with `dependencies.inject` is lost. The Swift
library does exactly the same (ReplaceDescendantInjectionTests), so PARITY_AUDIT Issue 21 is
not a library gap. Tests only; no production code changes.

Co-Authored-By: Claude Sonnet 5.5 <noreply@anthropic.com>
@sergihernanz
sergihernanz merged commit fa1d4e6 into main Nov 23, 2026
1 check passed
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.

1 participant