Skip to content

[Bug]: Backup failure toast crashes on formatPlural IllegalArgumentException #1069

Description

@piotr-iohk

What happened?

On production 2.3.1 (build 184), Play Vitals reports 2 crash events (1 user) with:

java.lang.IllegalArgumentException
  at android.icu.text.MessagePattern.parsePluralOrSelectStyle (MessagePattern.java:1157)
  at android.icu.text.MessageFormat.applyPattern (MessageFormat.java:449)
  at to.bitkit.ext.StringKt.formatPlural (String.kt:35)
  at to.bitkit.repositories.BackupRepo$showBackupFailureNotification$1.invokeSuspend (BackupRepo.kt:440)

When periodic backup check detects failed backups, BackupRepo.showBackupFailureNotification() formats settings__backup__failed_message via ICU MessageFormat. Parsing the pattern throws before the error toast can be shown.

Expected behavior

Failed backup notification should display localized retry message (e.g. "Retrying in 1 minute") without crashing.

Steps to Reproduce

  1. Use Bitkit with locale set to a language with a malformed settings__backup__failed_message translation (suspected: Italian, Czech).
  2. Trigger a VSS backup failure so showBackupFailureNotification() runs (failed backup detected on periodic check).
  3. App crashes with IllegalArgumentException in formatPlural.

Suspected malformed translations in repo:

  • values-it/strings.xml: {interval, plural, one {# minute} o {# minutes}} — uses o instead of ICU keyword other
  • values-cs/strings.xml: {interval, plural, one {# minute} dalších {# minutes}} — missing other branch keyword

English pattern (valid): {interval, plural, one {# minute} other {# minutes}}

Logs / Screenshots / Recordings

  • Play Vitals screenshot (2026-07-13 weekly report)
  • Stack trace above

Bitkit Version

2.3.1 (build 184) — production mainnet

Device / OS

Motorola ThinkPhone 25 by motorola, Android 16 (SDK 36). Likely non-English locale given suspected malformed ICU plural translations.

Reproducibility

Rarely (once or twice) — 1 user / 2 events on 2.3.1 since Jun 29 rollout. May be Always when backup fails + affected locale.

Additional context

Metadata

Metadata

Assignees

Labels

No labels
No labels

Type

Fields

No fields configured for Bug.

Projects

No projects

Milestone

No milestone

Relationships

None yet

Development

No branches or pull requests

Issue actions