glutanimate / review-heatmap

Anki add-on to help you keep track of your review activity
https://ankiweb.net/shared/info/1771074083
Other
1.2k stars 88 forks source link

Working on my medical school profile. Error when opening my Japanese profile. #161

Closed okBryan closed 2 years ago

okBryan commented 2 years ago

I get the error below when opening up my Japanese profile but not my medical profile. The add-on does not show after this. When I open the medical profile again, it works.

Checklist

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

Information about your Anki set-up

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.52 (ab1c2395) Python 3.9.7 Qt 6.3.0 PyQt 6.3.0
    Platform: Windows 10
    Flags: frz=True ao=True sv=3
    Add-ons, last update check: 2022-05-23 15:25:50

    ===Add-ons (active)===
    (add-on provided name [Add-on folder, installed at, version, is config changed])
    AMBOSS add-on ['0amboss_addon', 2022-01-19T14:42, 'None', mod]
    Advanced Browser ['874215009', 2022-01-30T17:07, 'None', '']
    AnKing Note Types Easy Customization ['952691989', 2022-03-29T11:30, 'None', mod]
    Anki Simulator ['817108664', 2021-08-07T14:24, 'None', '']
    BetterSearch ['1052724801', 2022-01-25T16:25, 'None', '']
    Button Colours Good Again ['2494384865', 2021-04-06T09:57, 'None', '']
    Card Info During Review ['2179254157', 2022-04-15T00:26, 'None', '']
    Control Audio ['1591259314', 2020-08-25T02:17, 'None', '']
    Customize Keyboard Shortcuts ['24411424', 2022-05-13T01:39, 'None', mod]
    Fastbar- with nightmode support ['46611790', 2022-04-14T22:04, 'None', '']
    Japanese Support ['3918629684', 2022-03-13T22:32, 'None', '']
    Maximum image height and width in card editor ['229181581', 2021-07-23T01:01, 'None', '']
    Migaku Dictionary ['1655992655', 2021-07-02T15:55, 'None', mod]
    Migaku Editor ['1051095155', 2021-06-28T21:06, 'None', mod]
    Migaku Japanese ['278530045', 2021-04-12T17:36, 'None', mod]
    Migaku Vacation ['605638174', 2021-01-13T18:36, 'None', mod]
    ReColor ['688199788', 2022-03-02T10:11, '1.8', mod]
    RefoldEase ['819023663', 2021-12-12T17:49, 'None', mod]
    Review Heatmap ['1771074083', 2022-05-18T10:53, 'None', '']

    ===IDs of active AnkiWeb add-ons===
    1051095155 1052724801 1591259314 1655992655 1771074083 2179254157 229181581 24411424 2494384865 278530045 3918629684 46611790 605638174 688199788 817108664 819023663 874215009 952691989

    ===Add-ons (inactive)===
    (add-on provided name [Add-on folder, installed at, version, is config changed])
    Anki Zoom ['538879081', 2020-04-03T19:20, 'v1.1.3', mod]
    BetterTags ['bettertags', 2020-01-21T12:32, 'None', '']
    Japanese Pronunciation  Pitch Accent ['932119536', 2019-08-13T08:05, 'None', '']
    Legacy ReMemorize Rescheduler with sibling and logging v142 ['323586997', 2020-11-19T23:27, 'None', mod]
    Special Fields ['1102281552', 2022-02-23T11:27, 'None', mod]

Error message (if any)

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.52 (ab1c2395) Python 3.9.7 Qt 6.3.0 PyQt 6.3.0
Platform: Windows 10
Flags: frz=True ao=True sv=3
Add-ons, last update check: 2022-05-23 15:25:50

Traceback (most recent call last):
  File "aqt.main", line 573, in loadCollection
  File "aqt.main", line 672, in moveToState
  File "aqt.main", line 678, in _deckBrowserState
  File "aqt.deckbrowser", line 69, in show
  File "aqt.deckbrowser", line 144, in _renderPage
  File "aqt.deckbrowser", line 153, in __renderPage
  File "aqt.hooks_gen", line 1444, in __call__
  File "C:\Users\Bryan\AppData\Roaming\Anki2\addons21\1771074083\views.py", line 81, in on_deckbrowser_will_render_content
    heatmap_html = self._controller.render_for_view(self._view)
  File "C:\Users\Bryan\AppData\Roaming\Anki2\addons21\1771074083\controller.py", line 77, in render_for_view
    return self._renderer.render(view, limhist, limfcst, current_deck_only)
  File "C:\Users\Bryan\AppData\Roaming\Anki2\addons21\1771074083\renderer.py", line 152, in render
    report = self._reporter.get_report(
  File "C:\Users\Bryan\AppData\Roaming\Anki2\addons21\1771074083\activity.py", line 131, in get_report
    history_start, forecast_stop = self._get_time_limits(limhist, limfcst)
  File "C:\Users\Bryan\AppData\Roaming\Anki2\addons21\1771074083\activity.py", line 303, in _get_time_limits
    history_start = self._get_conf_history_limit(
  File "C:\Users\Bryan\AppData\Roaming\Anki2\addons21\1771074083\activity.py", line 328, in _get_conf_history_limit
    if not limit_date or limit_date == daystart_epoch(self._db, self._col.crt):
  File "anki._legacy", line 78, in __getattr__
AttributeError: 'Collection' object has no attribute 'crt'
glutanimate commented 2 years ago

Hey Bryan, thanks for the report! The latest development build should contain a workaround for this. Would appreciate it if you gave it a try and let me know if it works for you.

This particular fix will land in v1.0.1, but more fixes for multi-profile handling are also on their way. You can the track progress on that in #159, in case you stumble on more issues when switching between profiles (which could very well be the case with v1.0.0 and v1.0.1).

okBryan commented 2 years ago

Works great, thanks.

okBryan commented 2 years ago

Opened my profile again today and this came up:

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.52 (ab1c2395) Python 3.9.7 Qt 6.3.0 PyQt 6.3.0 Platform: Windows 10 Flags: frz=True ao=True sv=3 Add-ons, last update check: 2022-05-25 08:41:45

Traceback (most recent call last): File "aqt.main", line 573, in loadCollection File "aqt.main", line 672, in moveToState File "aqt.main", line 678, in _deckBrowserState File "aqt.deckbrowser", line 69, in show File "aqt.deckbrowser", line 144, in _renderPage File "aqt.deckbrowser", line 153, in __renderPage File "aqt.hooks_gen", line 1444, in call File "C:\Users\Bryan\AppData\Roaming\Anki2\addons21\review_heatmap\views.py", line 81, in on_deckbrowser_will_render_content heatmap_html = self._controller.render_for_view(self._view) File "C:\Users\Bryan\AppData\Roaming\Anki2\addons21\review_heatmap\controller.py", line 77, in render_for_view return self._renderer.render(view, limhist, limfcst, current_deck_only) File "C:\Users\Bryan\AppData\Roaming\Anki2\addons21\review_heatmap\renderer.py", line 152, in render report = self._reporter.get_report( File "C:\Users\Bryan\AppData\Roaming\Anki2\addons21\review_heatmap\activity.py", line 134, in get_report history = self._cards_done( File "C:\Users\Bryan\AppData\Roaming\Anki2\addons21\review_heatmap\activity.py", line 487, in _cards_done deck_limit = self._revlog_limit(current_deck_only) File "C:\Users\Bryan\AppData\Roaming\Anki2\addons21\review_heatmap\activity.py", line 381, in _revlog_limit dids = self._valid_decks(excluded_dids) File "C:\Users\Bryan\AppData\Roaming\Anki2\addons21\review_heatmap\activity.py", line 358, in _valid_decks children = [d[1] for d in self._col.decks.children(did)] File "anki.decks", line 460, in children File "anki.decks", line 453, in deck_and_child_name_ids File "anki._backend.generated", line 454, in get_deck_and_child_names File "anki._backend", line 146, in _run_command anki.errors.NotFoundError