Skip to content

Commit 192ac03

Browse files
committed
Improve crash log reliability
- Replace single pending crash storage with a bounded durable crash queue - Add synchronous Timberlogs upload results and WorkManager retry for failed crash uploads - Report actionable process exits for ANR, native crash, low-memory, and signal cases - Add focused tests for crash queueing, upload outcomes, logger behavior, and process-exit filtering 🤖 Auto-generated
1 parent 4297249 commit 192ac03

13 files changed

Lines changed: 957 additions & 91 deletions

File tree

app/build.gradle.kts

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -186,6 +186,7 @@ dependencies {
186186
implementation(libs.credentials)
187187
implementation(libs.credentials.play.services.auth)
188188
implementation(libs.googleid)
189+
implementation(libs.work.runtime.ktx)
189190
testImplementation(libs.junit)
190191
testImplementation(libs.coroutines.test)
191192
testImplementation(libs.json)

app/src/main/java/com/enaboapps/switchify/SwitchifyApplication.kt

Lines changed: 4 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -8,6 +8,7 @@ import androidx.lifecycle.ProcessLifecycleOwner
88
import com.enaboapps.switchify.service.stats.StatsCollector
99
import com.enaboapps.switchify.utils.CrashReporter
1010
import com.enaboapps.switchify.utils.Logger
11+
import com.enaboapps.switchify.utils.ProcessExitReporter
1112
import com.enaboapps.switchify.utils.Resources
1213
import kotlinx.coroutines.CoroutineScope
1314
import kotlinx.coroutines.Dispatchers
@@ -32,7 +33,8 @@ class SwitchifyApplication : Application() {
3233
// kicked off immediately below).
3334
Logger.init(this)
3435

35-
CrashReporter.uploadPendingCrashIfPresent(this)
36+
ProcessExitReporter.reportRecentExits(this)
37+
CrashReporter.enqueueUpload(this)
3638
CrashReporter.install(this)
3739

3840
// Initialize stats collector
@@ -77,4 +79,4 @@ class SwitchifyApplication : Application() {
7779
}
7880
})
7981
}
80-
}
82+
}

app/src/main/java/com/enaboapps/switchify/backend/preferences/PreferenceManager.kt

Lines changed: 2 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -59,6 +59,7 @@ class PreferenceManager(context: Context) {
5959
const val PREFERENCE_KEY_SETTINGS_TAB = "settings_tab"
6060
const val PREFERENCE_KEY_TELEMETRY_ENABLED = "telemetry_enabled"
6161
const val PREFERENCE_KEY_DEVICE_ID = "device_id"
62+
const val PREFERENCE_KEY_LAST_PROCESS_EXIT_TIMESTAMP = "last_process_exit_timestamp"
6263
const val PREFERENCE_KEY_ONBOARDING_CURRENT_STEP = "onboarding_current_step"
6364
const val PREFERENCE_KEY_ONBOARDING_USER_TYPE = "onboarding_user_type"
6465
const val PREFERENCE_KEY_ONBOARDING_IS_NEW_USER = "onboarding_is_new_user"
@@ -105,6 +106,7 @@ class PreferenceManager(context: Context) {
105106
PREFERENCE_KEY_REVIEW_LAST_SHOWN,
106107
PREFERENCE_KEY_TELEMETRY_ENABLED,
107108
PREFERENCE_KEY_DEVICE_ID,
109+
PREFERENCE_KEY_LAST_PROCESS_EXIT_TIMESTAMP,
108110
PREFERENCE_KEY_GEMMA_TERMS_ACCEPTED
109111
)
110112
}

0 commit comments

Comments
 (0)