jac241 / anki_killstreaks

A Halo and Call of Duty inspired add-on to gamify Anki and make reviewing more bearable
GNU Affero General Public License v3.0
17 stars 8 forks source link

Crash (possibly related to incompatibility with "Edit field during review") #6

Closed nicholas-camarda closed 4 years ago

nicholas-camarda commented 4 years ago

Experiencing a crash when I attempt to edit a card (cloze or basic) during review using the "edit field during review" add-on. Since it's a popular add-on I figured that I should report the issue. Hopefully, it's an easy fix. I haven't reproduced this error while editing an image occluded card. Here's the crash below:

Before the crash, editing the card:

Before crash

After editing card, crash:

During/After crash

Error ... Debug info: Anki 2.1.21 (f1734a47) Python 3.8.0 Qt 5.13.1 PyQt 5.14.1 Platform: Mac 10.15.3 Flags: frz=True ao=True sv=1 Add-ons, last update check: 2020-03-10 10:45:09 Add-ons possibly involved: Anki Killstreaks, Image Occlusion Enhanced for Anki 21 alpha, Edit Field During Review Cloze

Traceback (most recent call last):
  File "aqt/webview.py", line 30, in cmd
  File "aqt/webview.py", line 96, in _onCmd
  File "aqt/webview.py", line 422, in _onBridgeCmd
  File "</Applications/Anki.app/Contents/MacOS/decorator.pyc:decorator-gen-52>", line 2, in _linkHandler
  File "anki/hooks.py", line 530, in decorator_wrapper
  File "anki/hooks.py", line 527, in repl
  File "/Users/Nicholas/Library/Application Support/Anki2/addons21/385888438/__init__.py", line 226, in myLinkHandler
    reviewer._showAnswer()
  File "</Applications/Anki.app/Contents/MacOS/decorator.pyc:decorator-gen-18>", line 2, in _showAnswer
  File "anki/hooks.py", line 530, in decorator_wrapper
  File "anki/hooks.py", line 527, in repl
  File "/Users/Nicholas/Library/Application Support/Anki2/addons21/1374772155/main.py", line 233, in onShowAnswer
    return _old(self)
  File "aqt/reviewer.py", line 242, in _showAnswer
  File "aqt/gui_hooks.py", line 750, in __call__
  File "anki/hooks.py", line 475, in runHook
  File "/Users/Nicholas/Library/Application Support/Anki2/addons21/579111794/controllers.py", line 185, in call_method
    return getattr(factory_function(), method)(*args, **kwargs)
  File "/Users/Nicholas/Library/Application Support/Anki2/addons21/579111794/controllers.py", line 220, in on_show_answer
    self.store = self.store.on_show_answer()
  File "/Users/Nicholas/Library/Application Support/Anki2/addons21/579111794/streaks.py", line 175, in on_show_answer
    state_machines=[m.on_show_answer() for m in self.state_machines]
  File "/Users/Nicholas/Library/Application Support/Anki2/addons21/579111794/streaks.py", line 175, in <listcomp>
    state_machines=[m.on_show_answer() for m in self.state_machines]
AttributeError: 'AnswerShownState' object has no attribute 'on_show_answer'
jac241 commented 4 years ago

Shouldn't be hard to fix give me 15 or so minutes and I'll push an update to anki web

jac241 commented 4 years ago

Alright I pushed an update to anki web let me know if it works whenever you install it

nicholas-camarda commented 4 years ago

Works as far as I can tell -- thank you so much!! Love this add-on, great work