ankidroid / ankidroid/Anki-Android

[BUG]: Random mistaken "Failed to load xxx.bin" toast messages when using JS API

Abierto
#16,510 20 comentarios 0 reacciones 0 asignados Ver en GitHub
Bug Needs Author Reply Needs Triage
Lenguaje dominante
Kotlin
Estrellas
11.8k
Forks
2.9k
Merge medio
2 d 3 h
PR fusionados (30 d)
171

Descripción

### 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

### What are the steps to reproduce this bug?

Use the JS API a lot. It only happens randomly. Maybe it is possible to reproduce it reliably by calling some harmless API method in a loop.

### Expected behaviour

No error message should be displayed.

### Actual behaviour

Sometimes (no discernible pattern) AnkiDroid will throw a "Card Content Error: Failed to load 'xxx.bin'" warning, despite everything working fine. xxx being a name referring to an element of the JS API, e.g . "cardDue.bin", "cardMod.bin", "ttsSetLanguage". Maybe all strings from the jsApiList in AnkiDroid/src/main/assets/scripts/js-api.js are possible.

### Debug info

```text
AnkiDroid Version = 2.18.0 (464cf290cc77c3f2c562cb03b408b78a13be261b)

Backend Version = 0.1.38-anki24.04.1 (24.04.1 ccd9ca1a8309b80bcb50ddc5d99c7ce63440bce9)

Android Version = 13 (SDK 33)

ProductFlavor = full

Manufacturer = Google

Model = Pixel 4a

Hardware = sunfish

Webview User Agent = Mozilla/5.0 (Linux; Android 13; Pixel 4a Build/TQ3A.230805.001.S1; wv) AppleWebKit/537.36 (KHTML, like Gecko) Version/4.0 Chrome/124.0.6367.179 Mobile Safari/537.36

ACRA UUID = 4d6cad38-e805-4913-82fe-99652a272d86

FSRS Enabled = true

Crash Reports Enabled = true
```

### (Optional) Anything else you want to share?

I am pretty sure this began with JS-API 0.2 or 0.3.

This is the string: Card Content Error: Failed to load ‘%s’

This issue is related: https://github.com/ankidroid/Anki-Android/issues/10033

![WhatsApp Image 2024-05-30 at 22 18 58_9a9ce0e9](https://github.com/ankidroid/Anki-Android/assets/16080894/1a768223-7ccc-464d-a8d2-b03b7c5f2dd9)

### Research

- [X] I am reporting a bug specific to AnkiDroid (Android app)
- [X] I have checked the [manual](https://ankidroid.org/docs/manual.html) and the [FAQ](https://github.com/ankidroid/Anki-Android/wiki/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](https://docs.ankidroid.org/manual.html#betaTesting))

Guía de contribución

Abrir la guía de contribución

Evaluación

Este issue todavía no se ha evaluado.

Recibe los nuevos issues en tu correo

Un resumen breve de issues de GitHub para principiantes.