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 d18a95dad9
commit 78c9076281
4 changed files with 277 additions and 5 deletions

View File

@@ -123,6 +123,8 @@ fun Project.setupKover() {
"io.element.android.libraries.designsystem.theme.components.bottomsheet.*",
// Konsist code to make test fails
"io.element.android.tests.konsist.failures",
// Copied from Appyx
"io.element.android.libraries.architecture.appyx.SafeChildrenTransitionScope",
)
annotatedBy(
"androidx.compose.ui.tooling.preview.Preview",