Adding multiple card types shows "This will create 0 cards."
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?
- Make a basic note.
- Go to manage note types -> Basic -> edit.
- Add a card type. It should say "This will create 1 card. Proceed?" (or however many basic notes you have).
- If you try to add a card type again, it will say "This will create 0 cards. Proceed?".
Expected behaviour
It should display "This will create X card(s). Proceed?" where X is the number of notes with that note type.
Debug info
AnkiDroid Version = 2.24.0alpha2 (a0e65b9054ff4a4da5fa410a834cd0528518c0a6)
Backend Version = 0.1.63-anki25.09.2 (25.09.2 3890e12c9e48c028c3f12aa58cb64bd9f8895e30)
Android Version = 13 (SDK 33)
ProductFlavor = full
Device Info = Xiaomi | POCO | mondrian | mondrian_global | 23013PC75G | qcom
Webview User Agent = Mozilla/5.0 (Linux; Android 13; 23013PC75G Build/TKQ1.220905.001; wv) AppleWebKit/537.36 (KHTML, like Gecko) Version/4.0 Chrome/143.0.7499.146 Mobile Safari/537.36
ACRA UUID = 4afc3b3f-e93f-4a66-bc71-2b9476ef9eb0
FSRS = 5.1.0 (Enabled: true)
Crash Reports Enabled = true
(Optional) Anything else you want to share?
The message "This will create X cards." could be lying to the user if some cards end up empty (e.g. using conditional replacement).
A better alternative could be "This can create up to X card(s). Proceed?".
Research
- [x] I have checked the manual and the FAQ and could not find a solution to my issue
- [x] (Optional) I have confirmed the issue is not resolved in the latest alpha release (instructions)
Was able to reproduce by following the steps given
https://github.com/ankidroid/Anki-Android/blob/e4ceaa01b79706b6b7d7c71ff8844b0d07aac5ce/AnkiDroid/src/main/java/com/ichi2/anki/CardTemplateEditor.kt#L1331-L1340
@ShaanNarendran Could you take a look? I can't reproduce this
EDIT: I can reproduce this when pressing 'Add' on the added (3rd) card template, but not on the second
@ShaanNarendran Could you take a look? I can't reproduce this
EDIT: I can reproduce this when pressing 'Add' on the added (3rd) card template, but not on the second
Yep, same here I forgot to mention that
@david-allison if you create a new basic note and then edit it to try and add card types, I get the bug from the very first add itself. (Could be expected behaviour so would need follow up on this)
@ShaanNarendran I'm chatting with @xenonnn4w about a planned rewrite for this functionality
@david-allison I tried to look about the the cause and found that the culprit is the note type + ordinality based calculation of affected cards instead of only note type. I tried a modified tmplUseCount() (without ord) and it did solve the issue.
I also noticed that tmplUseCount() is marked with rust clean up, in Ank-Desktop they are not informing user about the affected cards but warning about the full synchronization needed.
I think we should inform the users about this.
If @xenonnn4w is not working on this please let me know, I would be happy to.
If @xenonnn4w is not working on this please let me know, I would be happy to.
Since, I've been following the related issues as I had made the original one a while ago, I believe they are getting the prs for the same merged.
Okay, no worries. Will look for other issues to solve.
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
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