Skip to content

fix(crash-reporting): don't crash if triggered before init - #21533

Open
david-allison wants to merge 1 commit into
ankidroid:mainfrom
david-allison:fix-crash-report
Open

fix(crash-reporting): don't crash if triggered before init#21533
david-allison wants to merge 1 commit into
ankidroid:mainfrom
david-allison:fix-crash-report

Conversation

@david-allison

Copy link
Copy Markdown
Member

Note

Assisted-by: Claude Fable 5

Purpose / Description

The main rationale was for tests below :AnkiDroid where a reporter setup was required (and no reasonable teardown was available).

  • onCreate() returns early when setupAnkiDroidApp() fails
  • ContentProviders are created before Application.onCreate()

⚠️ Trade-off: a missed setReporter() call now degrades to warnings instead of failing fast.

Approach

  • define UninitializedCrashReporter
  • define resetForTesting

How Has This Been Tested?

⚠️ Untested

Checklist

  • You have a descriptive commit message with a short title (first line, max 50 chars).
  • You have commented your code, particularly in hard-to-understand areas
  • You have performed a self-review of your own code
  • UI changes: include screenshots of all affected screens (in particular showing any new or changed strings)
  • UI Changes: You have tested your change using the Google Accessibility Scanner

* onCreate() returns early if `setupAnkiDroidApp()` fails
* ContentProvider performs an early init

We don't want these to crash.

Trade-off: a missed `setReporter()` call now degrades to warnings
instead of failing fast.

The rationale was also to allow tests to run without needed a no-op
crash report handler.

Assisted-by: Claude Fable 5
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Projects

None yet

Development

Successfully merging this pull request may close these issues.

1 participant