zjosua / Pokemanki

Catch and train Pokémon as you learn with Anki
https://ankiweb.net/shared/info/1041307953
Other
19 stars 5 forks source link

Anki crashing due to background thread handling UI operations #32

Closed jebra102 closed 1 year ago

jebra102 commented 1 year ago

Troubleshooting Checklist

Replace the space between the parentheses with an x to mark the items as verified.

Describe the bug

When I open my Stats page to check my Pokémon, Anki crashes. Doesn't happen with all Stats pages, just with some and not all the time. Some are guaranteed crashes, some only randomly.

If Anki shows an error message, copy and paste it between the backticks below. No Error message.

To Reproduce

Steps to reproduce the behavior:

  1. Open Stats page on a deck. Always a gamble which one will crash it.

Expected behavior

I expect Anki to not crash while I have the Pokemanki Addon active and try opening the stats page.

What have you tried?

Screenshots

Not applicable.

Information about your set-up

Open Anki, go to Help > About and click on "Copy Debug Info". Paste the result between the backticks below.


    Anki 2.1.54 (b6a7760c) Python 3.9.7 Qt 6.3.1 PyQt 6.3.1
    Platform: Windows 10
    Flags: frz=True ao=True sv=3
    Add-ons, last update check: 2022-11-30 12:01:29

    ===Add-ons (active)===
    (add-on provided name [Add-on folder, installed at, version, is config changed])
    Anki Simulator ['817108664', 2021-08-07T21:24, 'None', '']
    Anki-redesign ['308574457', 2022-10-28T02:36, 'None', mod]
    Custom Background Image and Gear Icon ['1210908941', 2022-11-28T19:08, 'None', mod]
    Fill the blanks - Multiple typecloze support ['1933645497', 2021-08-05T21:38, 'None', '']
    HyperTTS - Add speech to your flashcards ['111623432', 2022-11-10T10:24, 'None', mod]
    Puppy Reinforcement ['1722658993', 2020-03-02T21:23, 'None', '']
    Review Heatmap ['1771074083', 2022-06-30T03:43, 'None', '']

    ===IDs of active AnkiWeb add-ons===
    111623432 1210908941 1722658993 1771074083 1933645497 308574457 817108664

    ===Add-ons (inactive)===
    (add-on provided name [Add-on folder, installed at, version, is config changed])
    Multiple Choice for Anki ['1566095810', 2022-11-21T13:10, 'None', '']
    Pokmanki ['1041307953', 2022-11-30T10:20, 'None', mod]

What operating system are you using?

Additional context

Have had issues with Multiple Choice for Anki making the Pokemanki Addon disappear for a few days, but hoped for a fix coming in soon. If Multiple Choice for Anki is deactivated, Pokemanki appears, but has started crashing after today's update. System is in German, so if something is unclear, I'm happy to try and translate to English.

zjosua commented 1 year ago

Can you please run Anki from the console and see if you get any errors there?

And don't worry about translating, my native language is German too.

jebra102 commented 1 year ago

Yeah, just tried it, same issue. Some decks crash it, others just don't show me the pokemon. I exported all of my decks and made a bunch of new, random cards to see if it was my decks during the day. But it also happened with those decks.

zjosua commented 1 year ago

And did you get any output on the console?

jebra102 commented 1 year ago

Sorry, a bit tired, yeah, there you go. (i sure hope this is how posting a pic works here) image

zjosua commented 1 year ago

I was able to reproduce this now. Qt warning: QObject::setParent: Cannot set parent, new parent is in a different thread

The issue is likely caused by the background operation handling UI tasks. It only tries to do that when a Pokémon levelled or a new one was caught. That's why the issue seems to occur only irregularly.

You shold be able to work with Version 1.3.0 (downloadable from the github releases) for now.

jebra102 commented 1 year ago

Since I just checked in on the other threads I had open, this one has been fixed for me. No more issues with it. Thanks a bunch