Migaku-Kanji-Addon icon indicating copy to clipboard operation
Migaku-Kanji-Addon copied to clipboard

Error when click on "Study Now" after syncing

Open BurgBoi opened this issue 1 year ago • 3 comments

Describe the bug When I click on the "Study Now" button for any deck after syncing (there must be added/modified downloads), I get an error popup that only disappears after clicking close twice. It doesn't happen again until I sync another time. Everything works properly after closing the popup twice.

To Reproduce

  1. Setup Anki with the Core 2k/6k Optimized Japanese decks and a kanji deck.
  2. Sync Anki to two desktops, both with the Migaku Kanji add-on.
  3. Set up Migaku Kanji on both desktops, pulling kanji from the Core 2k/6k Optimized Japanese decks.
  4. Modify a Migaku Kanji card's keywords on one desktop and sync.
  5. Sync Anki on the other desktop.
  6. Click the "Study Now" button on any deck on the other desktop that was just synced.

Expected behavior I expected no error to pop up.

Desktop (please complete the following information):

  • Windows 10 Home version 1909
  • Anki version 2.1.54
  • Python 3.9.7 Qt 6.3.1 PyQt 6.3.1

The Error Popup

Error
An error occurred. Please start Anki while holding down the shift key, which will temporarily disable the add-ons you have installed.
If the issue only occurs when add-ons are enabled, please use the Tools > Add-ons menu item to disable some add-ons and restart Anki, repeating until you discover the add-on that is causing the problem.
When you've discovered the add-on that is causing the problem, please report the issue to the add-on author.
Debug info:
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=2
Add-ons, last update check: 2023-03-21 19:34:53

Caught exception:
Traceback (most recent call last):
  File "aqt.webview", line 42, in cmd
  File "aqt.webview", line 149, in _onCmd
  File "aqt.webview", line 624, in _onBridgeCmd
  File "aqt.overview", line 92, in _linkHandler
  File "aqt.main", line 672, in moveToState
  File "aqt.hooks_gen", line 3945, in __call__
  File "C:\Users\david.DESKTOP-RIEO0EL.000\AppData\Roaming\Anki2\addons21\Migaku Kanji GOD\reviewer.py", line 63, in learn_ahead_refresh_on_review_start
    aqt.mw.migaku_kanji_db.refresh_learn_ahead()
  File "C:\Users\david.DESKTOP-RIEO0EL.000\AppData\Roaming\Anki2\addons21\Migaku Kanji GOD\kanji.py", line 427, in refresh_learn_ahead
    self.make_cards_from_characters(ct, new, None)
  File "C:\Users\david.DESKTOP-RIEO0EL.000\AppData\Roaming\Anki2\addons21\Migaku Kanji GOD\kanji.py", line 621, in make_cards_from_characters
    aqt.mw.requireReset()
  File "aqt.main", line 785, in requireReset
  File "aqt.main", line 770, in reset
  File "aqt.main", line 722, in _synthesize_op_did_execute_from_reset
  File "aqt.hooks_gen", line 3091, in __call__
  File "aqt.main", line 730, in on_operation_did_execute
  File "aqt.reviewer", line 198, in op_executed
  File "aqt.reviewer", line 170, in refresh_if_needed
  File "aqt.reviewer", line 229, in nextCard
AttributeError: 'Reviewer' object has no attribute '_reps'

BurgBoi avatar Mar 22 '23 18:03 BurgBoi

Could you confirm that this is still an issue with the latest Kanji God versions?

Here's where you can see your installed version: image

MinmoTech avatar Jun 26 '23 13:06 MinmoTech

Yeah it's not happening, at least for now.

BurgBoi avatar Jun 27 '23 23:06 BurgBoi

@BurgBoi , @MinmoTech
This is a bug in Anki. Fortunately it doesn't happen very often. I made a PR just now

mjuhanne avatar Aug 06 '23 19:08 mjuhanne