Add code to help debugging the saved nav state graph (#6295)

* Add code to help debugging the saved nav state graph: this would help us diagnose the `TransactionTooLargeException` reports we've been seeing for months.
This commit is contained in:
Jorge Martin Espinosa 2026-03-06 15:44:30 +01:00 committed by GitHub
parent 0d033e06e2
commit e821f75a88
No known key found for this signature in database
GPG key ID: B5690EEEBB952194
4 changed files with 169 additions and 3 deletions

View file

@ -9,6 +9,8 @@
package io.element.android.features.rageshake.impl.crash
import android.os.Build
import android.os.TransactionTooLargeException
import io.element.android.libraries.architecture.appyx.lastCapturedNavState
import io.element.android.libraries.core.data.tryOrNull
import timber.log.Timber
import java.io.PrintWriter
@ -61,6 +63,13 @@ class VectorUncaughtExceptionHandler(
val sw = StringWriter()
val pw = PrintWriter(sw, true)
throwable.printStackTrace(pw)
if (throwable is RuntimeException && throwable.cause is TransactionTooLargeException) {
pw.append('\n')
pw.append(lastCapturedNavState)
Timber.v(lastCapturedNavState)
}
append(sw.buffer.toString())
}
Timber.e("FATAL EXCEPTION $bugDescription")