ankidroid / Anki-Android

AnkiDroid: Anki flashcards on Android. Your secret trick to achieve superhuman information retention.
GNU General Public License v3.0
8.7k stars 2.24k forks source link

[Bug] AnkiDroidJS.ankiGetCardFactor() and other functions always return 0 #12814

Closed fylux closed 1 year ago

fylux commented 2 years ago

In the latest alpha I was trying to use:

For some reason they all return 0. It does not happen with every API function, e.g. AnkiDroidJS.ankiGetCardDue() works well.

a

Reproduction Steps

1a. Add to a note type AnkiDroidJS.ankiGetCardFactor() 1b. Or simply use debug mode an in the console call AnkiDroidJS.ankiGetCardFactor()

  1. Visualize a card of this type in preview mode
Expected Result

Something >0

Actual Result

0

Debug info
Research

Enter an [x] character to confirm the points below:

welcome[bot] commented 2 years ago

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

mikehardy commented 2 years ago

Huh :thinking: thanks for reporting this. May be possible to reproduce this one with a unit test - I'm not sure there is much if any coverage of the JS API, and if some of the APIs are reproducibly returning 0 it should show up immediately under a unit test

fylux commented 2 years ago

Thank you for the quick reply. Fyi today I have analyzed in more detail how it can be reproduced:

notpx commented 1 year ago

Hey im new to this, i know about java and i would likr to help

mikehardy commented 1 year ago

Hey @notpx :wave: - feel free to open a PR on it, that would be most welcome

SySagar commented 1 year ago

I would like to work on this.

SySagar commented 1 year ago

I have an addition doubt. What is the expected return values of this function if not zero. AnkiDroidJS.ankiGetCardFactor() AnkiDroidJS.ankiGetCardReps() AnkiDroidJS.ankiGetCardLapses()

github-actions[bot] commented 1 year ago

Hello 👋, this issue has been opened for more than 3 months with no activity on it. If the issue is still here, please keep in mind that we need community support and help to fix it! Just comment something like still searching for solutions and if you found one, please open a pull request! You have 7 days until this gets closed automatically

fylux commented 1 year ago

Can anyone try to reproduce it in the latest version?

david-allison commented 1 year ago

Let's give this one another cycle

ryg-git commented 1 year ago

I would like to work on this issue

adityakrchy commented 1 year ago

I would like to work on the same. If possible, please assign me.

github-actions[bot] commented 1 year ago

Hello 👋, this issue has been opened for more than 3 months with no activity on it. If the issue is still here, please keep in mind that we need community support and help to fix it! Just comment something like still searching for solutions and if you found one, please open a pull request! You have 7 days until this gets closed automatically