glutanimate / speed-focus-mode

Speed Focus Mode add-on for Anki
https://ankiweb.net/shared/info/1046608507
Other
31 stars 11 forks source link

Potential incompatibility with Clickable Tags #27

Closed eungyeo closed 3 years ago

eungyeo commented 4 years ago

Problem description

Two errors:

  1. NoneType error for clickable tags--had this problem for a while but always ignored
  2. error message when closing Anki that required me to force quit--started recently, unfortunately I am not sure what I changed.

I had error #1 for a while but #2 error was recent. I disabled each add-on one by one and disabling the Speed Focus Mode add-on removed both errors. Also by re-activating the add-on both errors came back.

I had this error both with Anki 2.1.22 and now with the updated Anki 2.1.25

Checklist

Please replace the space inside the brackets with an x if the following items apply:

Information about your Anki set-up

Please fill out the section corresponding with your Anki version:

If you are using Anki 2.1

Please open Anki, go to Help → About, click on "Copy Debug Info", and paste the result between the backticks below (if the button does not appear you are using an older version of Anki 2.1 and will need to update first):


    Anki 2.1.25 (898801eb) Python 3.8.0 Qt 5.14.1 PyQt 5.14.1
    Platform: Windows 10
    Flags: frz=True ao=True sv=2
    Add-ons, last update check: 2020-05-01 22:31:01

    ===Add-ons (active)===
    (add-on provided name [Add-on folder, installed at, version, is config changed])
      Advanced Review Bottom Bar   ['1136455830', 2020-05-01T10:32, 'None', mod]
    AMBOSS add-on ['0amboss_addon', 2020-02-03T17:28, 'None', '']
    Advanced Copy Fields ['1898445115', 2019-05-03T14:46, 'None', '']
    Anki Habitica for 21 ['1758045507', 2020-03-24T04:28, 'None', mod]
    Anki Simulator ['anki_simulator', 2020-03-28T15:47, 'None', '']
    Batch Editing ['291119185', 2020-02-05T21:24, 'None', '']
    BetterTags ['bettertags', 2020-04-28T11:40, 'None', mod]
    Browser Search Box Quick Insert Tag Deck Notetype ['1052724801', 2020-04-27T08:02, 'None', '']
    Clickable Tags v11 ['380714095', 2020-03-22T09:56, 'None', '']
    Edit Field During Review Cloze ['385888438', 2020-04-28T22:30, 'None', mod]
    External Note Editor for the Browser ['browser_external_note_editor', 2020-03-10T13:42, 'None', '']
    Free Weekend - or Any Other Day ['742185195', 2020-04-10T07:57, 'None', mod]
    Hint Hotkeys ['1844908621', 2020-02-05T20:13, 'None', '']
    Image Occlusion Enhanced for Anki 21 alpha ['1374772155', 2020-04-27T22:21, 'None', '']
    More Decks Stats and Time Left ['1556734708', 2020-03-31T16:19, 'None', '']
    More Overview Stats 21 ['738807903', 2020-02-05T20:09, 'None', '']
    No Distractions Full Screen Clean review interface  TabletTouch support ['1049863218', 2020-04-25T21:47, 'v4.1.6', mod]
    Postpone cards review ['1152543397', 2020-04-04T19:11, 'None', '']
    Progress Bar ['2091361802', 2020-02-09T12:03, 'None', '']
    Puppy Reinforcement ['puppy_reinforcement', 2020-03-02T14:22, 'None', '']
    ReMemorize Rescheduler with sibling and logging v140 ['323586997', 2020-04-17T03:07, 'None', mod]
    Refocus Card when Reviewing 21 ['1642550423', 2018-09-19T10:14, 'None', '']
    Review Heatmap ['review_heatmap', 2018-10-28T18:06, 'None', '']
    Special Fields ['1102281552', 2020-03-28T19:58, 'None', mod]
    Speed Focus Mode ['speed_focus_mode', 2019-06-28T18:35, 'None', '']
    True Retention by Card Maturity ['923360400', 2017-08-29T15:00, 'None', '']
    load balancer ['1417170896', 2020-02-17T15:02, 'None', '']

    ===IDs of active AnkiWeb add-ons===
    1049863218 1052724801 1102281552 1136455830 1152543397 1374772155 1417170896 1556734708 1642550423 1758045507 1844908621 1898445115 2091361802 291119185 323586997 380714095 385888438 738807903 742185195 923360400

    ===Add-ons (inactive)===
    (add-on provided name [Add-on folder, installed at, version, is config changed])
    Cloze Overlapper ['cloze_overlapper', 2019-02-01T07:37, 'None', '']
    HoochieBaby Queue Controller  Day-Lrn Q ['1847358755', 2020-04-24T23:16, 'None', '']
    HoochieMama Randomize Rev Queue ['1460733408', 2020-04-24T23:16, 'None', '']
    Image Style Editor ['1593969147', 2020-03-22T14:37, 'None', mod]
    ImageResizer ['1214357311', 2020-02-18T17:26, 'None', '']
    Knockout Deck Subset Learning ['899747926', 2019-02-23T16:59, 'None', '']
    PDF Glossary Exporter ['pdf_glossary', 2019-08-19T08:35, 'None', '']
    Pokemanki ['633922407', 2020-03-03T22:10, 'None', '']
    Pop-up Wikipedia Beta ['395343016', 2020-02-05T21:36, 'None', '']
    Reset Ease ['947935257', 2019-11-14T18:57, 'None', '']
    Visual Feedback for Reviews ['review_feedback', 2020-01-28T15:32, 'None', '']
    Zoom 21 ['1846592880', 2020-01-12T12:26, 'None', '']
If you are using Anki 2.0

Please open Anki, go to Help → About, find the two lines starting with Version: and Qt, and copy-paste them between the backticks below:

Please fill in details about your operating system (Windows/macOS/Linux, which version):

Please open Anki, go to Tools → Add-ons, take a screenshot of your installed add-ons, and paste it below:

Error message (if any)

If you've received an error message, please copy and paste it between the backticks below:

Error 1: (clickable tags)

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 on the add-on support site.
Debug info:
Anki 2.1.25 (898801eb) Python 3.8.0 Qt 5.14.1 PyQt 5.14.1
Platform: Windows 10
Flags: frz=True ao=True sv=2
Add-ons, last update check: 2020-05-01 22:31:01

Caught exception:
Traceback (most recent call last):
  File "aqt\webview.py", line 34, in cmd
  File "aqt\webview.py", line 114, in _onCmd
  File "aqt\webview.py", line 512, in _onBridgeCmd
  File "aqt\gui_hooks.py", line 2091, in __call__
  File "C:\Users\Eunhae\AppData\Roaming\Anki2\addons21\380714095\__init__.py", line 87, in handle_click
    browser.setFilter('"tag:%s"' % tag)
AttributeError: 'NoneType' object has no attribute 'setFilter'

Error 2: (error on Anki quit)

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 on the add-on support site.
Debug info:
Anki 2.1.25 (898801eb) Python 3.8.0 Qt 5.14.1 PyQt 5.14.1
Platform: Windows 10
Flags: frz=True ao=True sv=2
Add-ons, last update check: 2020-05-01 22:31:01

Caught exception:
Traceback (most recent call last):
  File "aqt\main.py", line 973, in closeEvent
  File "aqt\main.py", line 436, in unloadProfileAndExit
  File "aqt\main.py", line 411, in unloadProfile
  File "aqt\main.py", line 519, in unloadCollection
  File "aqt\main.py", line 783, in closeAllWindows
  File "aqt\__init__.py", line 107, in closeAll
  File "aqt\main.py", line 515, in callback
  File "aqt\mediasync.py", line 143, in show_diag_until_finished
AttributeError: 'NoneType' object has no attribute 'exec_'
glutanimate commented 4 years ago

Hi eungyeo,

Thanks for the report!

Unfortunately judging by the error messages, none of them seem to be related to Speed Focus Mode. Error 1 is produced by clickable tags with no interaction of SFM, and error 2 seems to be an Anki bug. Errors like these can occur intermittently (i.e. every now and then), and so it can be easy to misattribute them to a recent change (or to attribute their disappearance to disabling a particular add-on for one session, even though it might just be that that session happened to be "error-free" anyway).

To conclusively determine whether this is influenced in any way by SFM's presence, please disable SFM for a few days and see if the errors come up again.

Even then, judging by the error messages alone, it would be incredibly unlikely for SFM to have any role in this. Both of the errors pertain to areas of Anki that SFM does not interact with (the card browser and the media synchronization module).

eungyeo commented 4 years ago

As suggested, I disabled SFM and had no errors, but I reactivated it again today and received the same error messages.

I'm pretty mystified why I'm receiving these errors since like you said it seems to be in an area far removed from SFM, but in any case disabling the add-on resolves the issue for me.

giovannihenriksen commented 4 years ago

I am also seeing error 2 only occurring when SFM is enabled. It seems to be caused by line 333 of config.py (the error disappears when I remove this line): aqt.DialogManager.open = wrap(aqt.DialogManager.open, onDialogOpened, "after")

It also only occurs when 'Automatically sync on profile open/close' is enabled (this is when the sync dialog pops up)

glutanimate commented 4 years ago

@giovannihenriksen thanks for chiming in! That was very helpful info as my test systems do not have sync set up (for obvious reasons).

Might be some kind of race condition then (with SFM's monkey patch delaying things and thus potentially triggering a bug in Anki).

Let's move all discussion in relation to the issue when closing Anki to #28, as that report is more focused on that.

@eungyeo as for issue 1: have you been able to confirm whether this happens regardless of SFM? It's really unlikely that this is caused by SFM and my hunch would be that it's an issue in Clickable Tags.

eungyeo commented 4 years ago

Hello, I did not use SFM for several weeks and did not encounter any issues during that time. I reinstalled SFM today and received the same error.

Interestingly enough, I did not get any error messages from the SFM on ankiweb. It seems to be only with the 0.4.0-beta.1 version posted here on github.

Unfortunately, I have changed several add-ons since my first posting, so my results may not be a very good comparison.

felipemldias commented 3 years ago

I can confirm I've encountered the same issue with SFM, both with clickable tags and Review Heatmap.

jaredagordon commented 3 years ago

Same here with issues with the beta SFM with clickable tags and Review Heatmap

glutanimate commented 3 years ago

Thanks a bunch for the reports, guys! This should now be fixed in the main branch and find its way into the next release (which will go live on 09/09 on Patreon and be posted to AnkiWeb later this fall.