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] V3 Scheduler: "Invalid input: card was modified" while answering card #12946

Closed
4 tasks done
user1823 opened this issue Dec 10, 2022 · 22 comments · Fixed by #15292
Closed
4 tasks done

[Bug] V3 Scheduler: "Invalid input: card was modified" while answering card #12946

user1823 opened this issue Dec 10, 2022 · 22 comments · Fixed by #15292
Labels
Backend Related May have something to do with Rust, related to Anki-Android-Backend Bug
Milestone

Comments

@user1823
Copy link
Contributor

Reproduction Steps
  1. Start reviewing cards.
  2. Click the show answer button.
  3. Rate the card as good.
Expected Result

The next card is shown.

Actual Result

Sometimes, the following error is shown instead.

IMG_20221210_085645

Note that this error occurs very rarely, maybe about once a week.

Debug info

AnkiDroid Version = 2.16alpha91

Android Version = 7.0

Manufacturer = motorola

Model = Moto C Plus

Hardware = mt6735

Webview User Agent = Mozilla/5.0 (Linux; Android 7.0; Moto C Plus Build/NRD90M.03.045; wv) AppleWebKit/537.36 (KHTML, like Gecko) Version/4.0 Chrome/107.0.5304.141 Mobile Safari/537.36

ACRA UUID = c6a580cb-02cc-4970-b7a5-24615e6542e1

New schema = true

Scheduler = std3

Crash Reports Enabled = true

DatabaseV2 Enabled = true

Research

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

  • I have read the support page and am reporting a bug or enhancement request specific to AnkiDroid
  • I have checked the manual and the FAQ and could not find a solution to my issue
  • I have searched for similar existing issues here and on the user forum
  • (Optional) I have confirmed the issue is not resolved in the latest alpha release (instructions)
@dae
Copy link
Contributor

dae commented Dec 10, 2022

Is it possible you are performing some action via the menus before answering that card? In the past this happened when people did things like suspend a card while reviewing.

@user1823
Copy link
Contributor Author

user1823 commented Dec 10, 2022

The issue mostly occurs when I click "show answer", then edit the card and then rate the card.
However, doing this doesn't cause the issue in most cases but only in some cases.

But today, I suppose that I didn't perform any action via the menus before answering the card.

@user1823
Copy link
Contributor Author

I think this can be confirmed from the error report generated by AnkiDroid.

@dae
Copy link
Contributor

dae commented Dec 10, 2022

The logs don't make this clear. Please keep an eye out for any actions you're taking around the time the problem occurs, as that will help to narrow it down.

To devs: I believe this happens because AnkiDroid is performing some operation on the database. The top of the review queue can then change (eg because a learning card has become due), but the reviewer still thinks the previous card is the current one. This will happen when an operation uses raw SQL, or was not invoked with undoableOp.

@user1823
Copy link
Contributor Author

This happened again.

I rated the card but nothing happened. Then, I rated the card again and I was shown the same error. When I dismissed the error, the next due card was shown.

And this time, I am sure that I didn't do anything via the menu.

@dae
Copy link
Contributor

dae commented Dec 12, 2022

If you see the same thing again, it may be worth looking up the card info of the card where nothing happened - I suspect it will show that the card was actually reviewed, and that the UI has failed to indicate it for some reason. Getting to the bottom of this may require adding some extra logging or digging through this part of the code. As some changes to this area will need to be made in #12620, this may need to wait until someone has the time to pick that up.

@david-allison david-allison changed the title [Bug] Error while answering card [Bug] V3 Scheduler: "Invalid input: card was modified" while answering card Jan 30, 2023
@github-actions
Copy link
Contributor

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

@github-actions github-actions bot added the Stale label Apr 30, 2023
@user1823
Copy link
Contributor Author

user1823 commented May 1, 2023

I have not seen this error message since a while. But, because this message used to appear on rare occasions, I can't be sure about whether this issue has been resolved or not.

@github-actions github-actions bot removed the Stale label May 1, 2023
@david-allison
Copy link
Member

It's not fixed. To be fixed in 2.17

@david-allison david-allison added Bug Backend Related May have something to do with Rust, related to Anki-Android-Backend labels May 1, 2023
@homocomputeris
Copy link

I get this error but I don't see any logic behind, seems completely random:
Screenshot_20230611-232107_AnkiDroid

@dae
Copy link
Contributor

dae commented Sep 1, 2023

We'll need reproduction steps to track this down. If it still occurs after a 2.17 alpha release, please let us know the steps we should take to trigger this.

@someone120
Copy link

Sometimes I click the rate button and then the UI surface gets stuck. Then I click the rate button again, and I get this error.

@mikehardy mikehardy added this to the 2.17 release milestone Nov 23, 2023
@mikehardy
Copy link
Member

I'm going to move this off the 2.17 release milestone - not because we don't believe it is happening - but because it was already happening in 2.16 and I don't think it is a regression so it should not block a new public release

We'll try to fix it as soon as we have solid reproduction steps but we want to make sure all the other fixes we have queued up are released as quickly as possible so we don't want to block the release

@mikehardy mikehardy modified the milestones: 2.17 release, 2.18 release Dec 9, 2023
@mikehardy mikehardy added the Can't reproduce bugs people file that we can't reproduce label Dec 9, 2023
@matejdro
Copy link

matejdro commented Dec 9, 2023

For what it's worth, I've been experiencing those pretty frequently a couple of releases back, but since 2.16 (I think) and 2.17 alpha, I've not experiencing it anymore. So at least some cases were fixed.

@mikehardy
Copy link
Member

@david-allison indicates:

Reproduced using the deck listed in: #14920

#14813 (comment)

I think that one is a duplicate so I'm closing it to focus here

@mikehardy
Copy link
Member

We're getting closer to a repro here I think - user khonkhortisan on discord posts this:

2.17alpha8+fsrs+gestures: I can tap on both sides of the screen to answer again-good or good-again and it says card was modified. I can do this reliably, if I wait half a second. Again-0.5s-good-cardwasmodified. or good-0.5s-again-cardwasmodified. but then I just tried it on another deck and got not at top of queue instead.

@homocomputeris
Copy link

I noticed this usually happens when a card is being reviewed when today is cut off (e.g. at the midnight) during review. Then this carried over card casts the error.

@david-allison
Copy link
Member

@david-allison david-allison removed this from the 2.18 release milestone Dec 23, 2023
@david-allison
Copy link
Member

david-allison commented Dec 23, 2023

There are at least 2 causes:

  1. rollover
  2. answering too quickly

Focusing on answering too quickly, this can be replicated by duplicating the line: answerCardInner(ease)

open fun answerCard(@BUTTON_TYPE ease: Int) {
launchCatchingTask {
if (mInAnswer) {
return@launchCatchingTask
}
mIsSelecting = false
if (mPreviousAnswerIndicator == null) {
// workaround for a broken ReviewerKeyboardInputTest
return@launchCatchingTask
}
// Temporarily sets the answer indicator dots appearing below the toolbar
mPreviousAnswerIndicator?.displayAnswerIndicator(ease)
mSoundPlayer.stopSounds()
mCurrentEase = ease
answerCardInner(ease)
updateCardAndRedraw()
}
}

@BrayanDSO is fixing this likely going to get in the way of your refactors in the area?

@david-allison david-allison removed the Can't reproduce bugs people file that we can't reproduce label Dec 23, 2023
@BrayanDSO
Copy link
Member

@BrayanDSO is fixing this likely going to get in the way of your refactors in the area?

Nope. I don't care much to what happens to the AbstractFlashcardViewer/Reviewer/Previewer/CardTemplatePreviewer since I'm doing a re-write to implement #14302

@andreas1974
Copy link

andreas1974 commented Jan 16, 2024

Ver. 2.17 alpha 15.
(anki 23.12.1 / 1a1d4d54)

Answering the first card this morning I got the "card was modified" error message that is described here. I was not answering this card quickly. I don't understand the "start of next day"/rollover" issue that people mention and link to above.

Perhaps it is of no help, since you already know about it, but I thought I'd report this error.
image

(Off topic: I installed the alpha version yesterday, and since then I've had no "check you internet" popups, which I'm very thankful for, since I'm often offline when using Anki!)

@andreas1974
Copy link

I installed AnkiDroid 2.17.5 and I still get this "card modified" error when leaving a card open overnight (unrated) and rate it in the morning.
The issue is marked as closed, but I still get the same error.
It was also marked as "moved to Done in 2.17 - Rust Backend Migration on Jan 26"
So I'm not sure I'm writing on the correct issue now.

Version data copied from the about page:
AnkiDroid Version = 2.17.5 (1c1aa94)
Backend Version = 0.1.34-anki23.12.1 (23.12.1 1a1d4d5419c6b57ef3baf99c9d2d9cf85d36ae0a)
Android Version = 9 (SDK 28)
ProductFlavor = full
Manufacturer = LGE
Model = LG-H930
Hardware = joan
Webview User Agent = Mozilla/5.0 (Linux; Android 9; LG-H930 Build/PKQ1.190414.001; wv) AppleWebKit/537.36 (KHTML, like Gecko) Version/4.0 Chrome/120.0.6099.210 Mobile Safari/537.36
Crash Reports Enabled = true

Screenshot_20240314-082100

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
Backend Related May have something to do with Rust, related to Anki-Android-Backend Bug
Projects
Development

Successfully merging a pull request may close this issue.

9 participants