Yutsuten / anki-lifedrain

Anki add-on that adds a life bar to anki while reviewing.
https://ankiweb.net/shared/info/715575551
GNU Affero General Public License v3.0
23 stars 2 forks source link

Reviewing is very slow on Mac #164

Closed Yutsuten closed 1 year ago

Yutsuten commented 1 year ago

Issue originally reported by @akavi1 on #160

The issue

It looks like this. No error messages. The blue bar just moves back and forth for 1-5min then the next card shows up. My guess is that whatever calculations Life Drain is doing is taking far too long to calculate. It's definitely coming from this addon. And I tried on different decks with different numbers of cards. It's the same problem everywhere.

Processing

Seems that we have a OS specific issue, as it does not happen to me (on Linux) and other users on Windows. I don't have a Mac, so @akavi1 I need you to debug this with me.

First of all, lets return the add-on code back to the previous version. I have two reasons for this:

Restoring the previous version

Download v2.6.2

Download the source code of version 2.6.2 here. The zip version is probably easier to open.

After unarchiving all the files, open anki-lifedrain-2.6.2/, and what will matter for us is the src/ folder.

Replace add-on source code

Add-ons are placed at ~/Library/Application Support/Anki2 on Mac according to Anki's documentation.

On Mac computers, recent Anki versions store all their files in the ~/Library/Application Support/Anki2 folder. The Library folder is hidden by default, but can be revealed in Finder by holding down the option key while clicking on the Go menu. If you're on an older Anki version, your Anki files will be in your Documents/Anki folder.

There we will have an addons folder. For me, on Linux, its called addons21/. Inside it, the Life Drain code will be on the 715575551/ directory. Replace it with the src/ folder you downloaded. To not lose your configuration, you can back up 715575551/ moving it to somewhere else. With the src/ folder inside addons21/, restart Anki and it should be working. You can rename src/ to lifedrain/ or whatever if you want.

After doing this, is the issue fixed?


For my own reference, these are the changes between the previous version and the current version: v2.6.2..v2.7.1

akavi1 commented 1 year ago

Thank you, v2.6.2 works perfectly

Yutsuten commented 1 year ago

OK, nice. There is something I'm suspicious of.

Could you do the same thing with the branch master (still unreleased version) and see if it works? This is the download link: anki-lifedrain-master.zip

akavi1 commented 1 year ago

master initially worked, but I noticed it had reset my settings. So I applied my settings in config and restarted Anki and the processing bar showed up again.

I think the problem only appears when the bar position is set to Top. If I set it to Bottom, everything is fine.

Yutsuten commented 1 year ago

anki-lifedrain-2.7.zip

Above is a modified version of the latest release. It will measure the run time of most functions of Life Drain, and save the log into your home directory in a file named lifedrain.log.

It will output A LOT of data, so try to reproduce the bug as fast as possible and close Anki. Of course, wait for the processing bar to show and disappear by itself.

Then upload the log file here, please.

Edit: Each time you open Anki the content of the log file will be reset. Be aware of that. Edit2: A question. Does the life bar update (drains) while the progressing bar is shown?

akavi1 commented 1 year ago

I did it but there is no lifedrain.log file.

Does the life bar update (drains) while the progressing bar is shown?

no the bar is not visible

I've also noticed that I need to click on a deck twice before it opens as a result of this addon

Yutsuten commented 1 year ago

anki-lifedrain-2.7-debug-stdout.zip

Are you able to run Anki from a terminal? I've changed it to write the log to the terminal insted.

Yutsuten commented 1 year ago

More questions:

What are your Anki, python, Qt and OS versions? What are the add-ons you have installed?

Yutsuten commented 1 year ago

no the bar is not visible

Are you really in the review screen? Or in the overview screen? Could you share your meta.json file? It should be in the same directory as the code. It contains your Life Drain configuration.

Yutsuten commented 1 year ago

No more answers after months, so I'll just close this.