ankidroid / ankidroid/Anki-Android
architecture: how to exclude exceptions from Analytics/Crash Reporting
- Dominant language
- Kotlin
- Stars
- 11.8k
- Forks
- 2.9k
- Avg merge
- 2d 3h
- Merged PRs (30d)
- 171
Description
I'm not sure where all of that is best placed, so I'll leave that for now
_Originally posted by @BrayanDSO in https://github.com/ankidroid/Anki-Android/pull/19559#discussion_r2553544713_
----
We have 3 places where we perform filtering:
**ThrowableFilterService** - Crash Reporting only
https://github.com/ankidroid/Anki-Android/blob/5904c8a2119351c1e7d93dbd73ab88577a27ca30/AnkiDroid/src/main/java/com/ichi2/anki/servicelayer/ThrowableFilterService.kt#L89-L100
**runCatching { }**
https://github.com/ankidroid/Anki-Android/blob/4e50cdfb63e3e58cb4d2037010edbb51caec60d9/AnkiDroid/src/main/java/com/ichi2/anki/CoroutineHelpers.kt#L192-L205
**CrashReportData: only run after runCatching**
https://github.com/ankidroid/Anki-Android/blob/4e50cdfb63e3e58cb4d2037010edbb51caec60d9/AnkiDroid/src/main/java/com/ichi2/anki/CoroutineHelpers.kt#L651-L656
We should make an informed decision:
* ACRA-only filtering, or skip analytics as well?
* If we have a generic `runCatching`, should that treat filtering exceptions differently than if an exception is directly passed to `CrashReportService.sendExceptionReport`
* should other metadata/`onlyIfSilent` be settable by callers?
https://github.com/ankidroid/Anki-Android/blob/9be215482bb597c683aa62d03cf5e14bc74354ec/AnkiDroid/src/main/java/com/ichi2/anki/CrashReportService.kt#L287-L292
Contributor guide
Assessment
This issue has not been assessed yet.