A progress dialog is shown for background operations such as media syncing in Anki 23.10 Beta

Media syncing used to run silently in the background, but that’s no longer the case in the latest beta release.

The user has to wait until syncing finishes as the dialog can’t be canceled.

This is most likely caused by this commit in Anki: Serialize CollectionOp, and QueryOp by default · ankitects/anki@055d663 · GitHub

The simplest solution would be to call .without_collection() or pass uses_collection=False for new Anki versions.

@ProductTeam

3 Likes

Should this maybe be fixed in Anki itself? I’m not sure if showing the progress dialog should be the intended behavior when calling run_in_background.

Otherwise we would need to remember to use your proposed solution once we start supporting the new Anki version.

taskman.run_in_background() by itself still doesn’t show a progress dialog. I suspect the issue is that the media sync task is blocking some other task that calls .with_progress(). This can be confirmed by installing a deck then switching the current deck while media sync is in progress. You should notice that a progress dialog is shown. This is because Anki calls set_current_deck() as a CollectionOp so it has to wait until media syncing is done to actually change the deck!

2 Likes

That makes sense, thanks for the explanation!

The problem was fixed in the 2023-11-14.1. release of the add-on!

This topic was automatically closed 7 days after the last reply. New replies are no longer allowed.