mortii / anki-morphs

A MorphMan fork rebuilt from the ground up with a focus on simplicity, performance, and a codebase with minimal technical debt.
https://mortii.github.io/anki-morphs/
Mozilla Public License 2.0
52 stars 7 forks source link

Anki Freeze During Review with Ankimorph #88

Closed HQYang1979 closed 8 months ago

HQYang1979 commented 8 months ago

Anki freezes sometimes during review with Ankimorph, I have to Ctrl+Alt+Shift to kill it. Sadly there is no error messages but I pretty sure it has something to do with Ankimorph, mostly happens when skipping the cards.

Vilhelm-Ian commented 8 months ago

Can you open anki from terminal and tell us the output when that happens

mortii commented 8 months ago

@HQYang1979 Do you see the 'skipping cards' pop-up window when this happens? image

HQYang1979 commented 8 months ago

I'll have to wait for next freeze....

mortii commented 8 months ago

Let's give this a 3 week period, if it hasn't happened after that then the issue will be closed automatically.

HQYang1979 commented 8 months ago

I haven't encountered any freeze up till now, though I've been heavily using the addon.

HQYang1979 commented 8 months ago

image

Freeze....

mortii commented 8 months ago

Ok, so it happens before line 90 in reviewing_utils.py

label=f"Skipping {skipped_cards.total_skipped_cards} cards"

that narrows it down quite a bit.

@HQYang1979 What happens if you click the 'x' button on the little pop-up window?

HQYang1979 commented 8 months ago

@HQYang1979 What happens if you click the 'x' button on the little pop-up window?

Nothing happens. It doesn't respond.

mortii commented 8 months ago

I think this is probably a bug in the Anki API. I also think it might be a race condition bug, which is worst case scenario. I can't think of any way to solve this, unfortunately....

We should add this to the known bugs section. Hopefully it keeps being a rare occurrence.

HQYang1979 commented 8 months ago

image Freezed

HQYang1979 commented 8 months ago

image Freezed

Vilhelm-Ian commented 8 months ago

@HQYang1979 have you noticed any common behaviour. Can you run anki from now on through the terminal everytime

HQYang1979 commented 8 months ago

@HQYang1979 have you noticed any common behaviour. Can you run anki from now on through the terminal everytime

I will run through terminal from now on

mortii commented 8 months ago

image Freezed

Interesting... It could also potentially be other add-ons interfering. Maybe we can add more logging to make debugging easier.

HQYang1979 commented 8 months ago

image Freezed when press undone on browser (undo the merge)

mortii commented 8 months ago

@HQYang1979 perfect, its another add-on that is causing the problem. What's the name of the 3858888438 add-on?

HQYang1979 commented 8 months ago

@HQYang1979 perfect, its another add-on that is causing the problem. What's the name of the 3858888438 add-on?

Edit-Field-During-Review-Cloze

mortii commented 8 months ago

Edit-Field-During-Review-Cloze

Okay, I'll add it to the known problems section :+1:

HQYang1979 commented 8 months ago

image

I am not sure if this freezed is related to the ankimorph.

mortii commented 8 months ago

image

I am not sure if this freezed is related to the ankimorph.

Not that I can tell from the terminal at least. Maybe exiting the reviewer and browser before creating a backup might help--less likely for add-ons to interrupt anki.

HQYang1979 commented 8 months ago

image

I am not sure if this freezed is related to the ankimorph.

Not that I can tell from the terminal at least. Maybe exiting the reviewer and browser before creating a backup might help--less likely for add-ons to interrupt anki.

It actually is an auto backup by Anki itself

mortii commented 8 months ago

It actually is an auto backup by Anki itself

Interesting, didn't know that existed.

HQYang1979 commented 8 months ago

image another freeze during normal review

mortii commented 8 months ago

image another freeze during normal review

That sucks. Since there are no errors shown, and it happens before the AnkiMorphs starts looping through cards, I again think its a rare bug in the Anki API. Since AM uses this background operation API call every time a card is answered this potentially rare bug could become more noticeable then in other add-ons.

It could still potentially be another add-on that is somehow interfering. If you disable all the other add-ons and you still get the problem then it would narrow it down to a bug in either ankimorphs or the anki api.

mortii commented 8 months ago

Updated known problems: https://mortii.github.io/anki-morphs/user_guide/known-problems.html#freezing-when-reviewing

Sorry I couldn't fix it :(

github-actions[bot] commented 6 months ago

This issue has been automatically locked since there has not been any recent activity after it was closed. Please open a new issue for related bugs.