Fix TransactionTooLargeExceptions caused by Appyx (#6410)

* Fix `TransactionTooLargeExceptions` caused by Appyx

After a long debugging session, we discovered the code Appyx uses to clear the saved state of nodes that have been removed is not working because of a race condition, causing this saved state to grow indefinitely.

To fix it, we need to wait until the node has been disposed, which will call `SaveableStateHolder.removeState` once, removing the associated `SaveableStateRegistry`, and *then* call `removeState` again when we detect the node has been removed from the navigation graph.

Since these classes and APIs are private in Appyx, we had to copy and modify and use these copies.

* Remove ktlint checks on `SafeChildrenTransitionScope.kt`

* Don't count the new code for coverage
This commit is contained in:
Jorge Martin Espinosa 2026-03-23 18:07:00 +01:00 committed by GitHub
parent 4a79fdd9ff
commit 3a7faa8b76
No known key found for this signature in database
GPG key ID: B5690EEEBB952194
4 changed files with 277 additions and 5 deletions

View file

@ -76,6 +76,9 @@ allprojects {
filter {
exclude { element -> element.file.path.contains(generatedPath) }
exclude("io/element/android/tests/konsist/failures/**")
// This file comes from another project and we want to keep it as close to the original as possible
exclude("**/SafeChildrenTransitionScope.kt")
}
}
// Dependency check