Anki-Android icon indicating copy to clipboard operation
Anki-Android copied to clipboard

Bug: Crash Reporter (ACRA) uses stale language after in-app language change

Open Ratnesh5 opened this issue 2 months ago • 3 comments

Checked for duplicates?

  • [x] This issue is not a duplicate

Does it also happen in the desktop version?

  • [x] This bug does not occur in the latest version of Anki Desktop

What are the steps to reproduce this bug?

  1. Install the app and set the language to English.
  2. Go to settings and change the app language to a different language (e.g., Spanish).
  3. Trigger a crash before the application process is completely restarted.
  4. Observe that the ACRA crash report (and the ToastType.AUTO_TOAST message) uses the original English strings instead of the newly selected Spanish strings.

Expected behaviour

Expected: When a user changes their preferred language within the AnkiDroid settings, the crash reporter (ACRA) should use the newly selected language for its crash report metadata and associated toasts/dialogs.

Actual: If a user changes their language setting, ACRA is not re-initialized with the new language configuration. If the app subsequently crashes, the crash report is generated using the old language resources.

Debug info

AnkiDroid Version = 2.24.0 (ebcf8e0e34921628b9b8a496c66ffd4adbb3705f)  
Backend Version = 0.1.64-anki25.09.2 (25.09.2 3890e12c9e48c028c3f12aa58cb64bd9f8895e30)  
Android Version = 16 (SDK 36)  
ProductFlavor = play  
Device Info = samsung | samsung | a17x | a17xins | SM-A176B | s5e8535  
WebView Info = [com.google.android.webview | 792219903]: Mozilla/5.0 (Linux; Android 16; SM-A176B Build/BP4A.251205.006; wv) AppleWebKit/537.36 (KHTML, like Gecko) Version/4.0 Chrome/151.0.7922.199 Mobile Safari/537.36  
ACRA UUID = 0c065efa-6462-4251-8d75-d760b38b826b  
FSRS = 5.1.0 (Enabled: false)  
Crash Reports Enabled = true

(Optional) Anything else you want to share?

No response

Research

  • [x] I have checked the manual and the FAQ and could not find a solution to my issue
  • [ ] (Optional) I have confirmed the issue is not resolved in the latest alpha release (instructions)

Ratnesh5 avatar Sep 17 '26 17:09 Ratnesh5

Hello! 👋 Thanks for logging this issue. Please remember we are all volunteers here, so some patience may be required before we can get to the issue. Also remember that the fastest way to get resolution on an issue is to propose a change directly, https://github.com/ankidroid/Anki-Android/wiki/Contributing

welcome[bot] avatar Sep 17 '26 17:09 welcome[bot]

Thanks, we have a lot of these bugs (when a language change is performed before a restart).

Not something we're actively tracking right now - too low priority to deal with.

I'd accept a PR which edits our language change code to emit a Timber warning that this is a known bug.

david-allison avatar Sep 17 '26 18:09 david-allison

Thanks, we have a lot of these bugs (when a language change is performed before a restart).

Not something we're actively tracking right now - too low priority to deal with.

I'd accept a PR which edits our language change code to emit a Timber warning that this is a known bug.

Makes total sense! I've gone ahead and opened a PR that adds the Timber warning so it's documented for future reference. Thanks for taking a look!

Ratnesh5 avatar Sep 17 '26 18:09 Ratnesh5