Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

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

Open
4 of 5 tasks
silidev opened this issue May 30, 2024 · 6 comments
Open
4 of 5 tasks
Labels
Bug Needs Author Reply Waiting for a reply from the original author Needs Triage

Comments

@silidev
Copy link

silidev commented May 30, 2024

Checked for duplicates?

  • This issue is not a duplicate

Does it also happen in the desktop version?

  • 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

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

WhatsApp Image 2024-05-30 at 22 18 58_9a9ce0e9

Research

  • I am reporting a bug specific to AnkiDroid (Android app)
  • 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)
@silidev silidev changed the title [BUG]: Random mistaken "Failed to load cardDue.bin" toast messages when using JS API [BUG]: Random mistaken "Failed to load xxx.bin" toast messages when using JS API May 31, 2024
@david-allison
Copy link
Member

david-allison commented Jun 2, 2024

@silidev Could you provide a sample deck?

For diagnostics:

super.onReceivedError(view, request, error)

@david-allison david-allison added this to the 2.18.4 release milestone Jun 2, 2024
@silidev
Copy link
Author

silidev commented Jun 2, 2024 via email

@david-allison david-allison added the Needs Author Reply Waiting for a reply from the original author label Jun 3, 2024
@silidev
Copy link
Author

silidev commented Jun 4, 2024

Hi David! Unfortunately, I cannot reproduce it in my sample deck. My production collection is not suitable for testing by others. I hope I find time to build my own AnkiDroid from source. Then I will try to fix it myself and test it in my production collection. I guess you best close this issue for now. Thanks again for having a look at this.

@david-allison
Copy link
Member

david-allison commented Jun 4, 2024

I can get a slight reproduction with a CACHE_MISS error with showAnswer when attaching Chrome Dev tools

Let's leave this open, I know where it needs to be fixed, but I don't know why

@silidev Can you use logcat? I could add some diagnostic logs instead, which can be used to resolve this

@silidev
Copy link
Author

silidev commented Jun 4, 2024

@david-allison I never used logcat, but I have used the adb command line before and guess that it won't be that difficult, will it?

@silidev
Copy link
Author

silidev commented Jun 4, 2024

@david-allison By the way: Kind of the deeper reason, why this is a problem at all, is this: the toast message with the error is very low on the screen, hiding the answer buttons. If it would be positioned higher on the screen everything would be just fine.

Other toast messages are also a somewhat annoying, like "1 card rescheduled". In the current position the toast message is hiding the answer buttons. If it would be a little bit higher, higher than the answer buttons, it would be no problem it all. I understand that you are interested what is causing the error, but repositioning the toast message display to a higher Y-position would improve the user experience for all types of toast messages.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
Bug Needs Author Reply Waiting for a reply from the original author Needs Triage
Projects
None yet
Development

No branches or pull requests

3 participants