ankitects / ankitects/anki

Missing undo action if Load Balancer is turned on / off (works only after rebuilding the queues)

Open
#3,918 1 comment 0 reactions 0 assignees View on GitHub
Dominant language
Rust
Stars
30.5k
Forks
3.2k
Avg merge
2d 7h
Merged PRs (30d)
66

Description

Source: https://github.com/ankitects/anki/pull/3860#issuecomment-2797534995

# Issue
If the load balancer is toggled to `True` or `False` via the debug console, no undo action is available via Ctrl+z or **edit → undo**. @YukiNagat0 pointed out, that it does appear after the queues are rebuild, e.g. by clicking on any deck on the main screen. Only after this step is the undo action available.

# Expected Behavior
The undo action should be available without having to click on a deck.

# Steps to reproduce
1. Create a new profile.
2. Open the console.
3. Type `pp(mw.col.load_balancer_enabled)` and observe that it's set to `True`.
4. Turn LB off by typing `mw.col.load_balancer_enabled = False`.
5. Type `pp(mw.col.load_balancer_enabled)` again and see that it now is set to `False`.
6. Close the debug window.
7. Try to Ctrl+z or **edit → undo** and observe that it fails (undo action is empty).
8. Click on a deck in the main screen.
9. Now try to Ctrl+z or **edit → undo** and observe that it now does indeed work.

# Version
Latest version built today:

```
Anki 25.02 (8fc822a6) (src) (ao)
Python 3.9.18 Qt 6.6.2 PyQt 6.6.1
Platform: Linux-6.12.19-amd64-x86_64-with-glibc2.41

===Add-ons (active)===
(add-on provided name [Add-on folder, installed at, version, is config changed])
AnkiWebView Inspector ['31746032', 2023-06-27T21:26, 'None', '']

===IDs of active AnkiWeb add-ons===
31746032

===Add-ons (inactive)===
(add-on provided name [Add-on folder, installed at, version, is config changed])
Image Occlusion Enhanced ['1374772155', 2022-04-09T09:15, 'None', '']
Review Heatmap ['1771074083', 2022-06-30T03:43, 'None', '']
Study Time Stats ['1247171202', 2024-02-24T17:59, 'None', '']
```

Contributor guide

Open the contributing guide

Research direction

Reproduce the behavior from the debug console using mw.col.load_balancer_enabled, then trace the edit → undo action before and after clicking a deck on the main screen. Done means toggling the value through the console immediately makes the undo action available and Ctrl+z restores the previous value without rebuilding the queues.

Written by the indexing model from the issue text.

Assessment

Tech stack
python
Domain
desktop
Issue type
Bug
Difficulty
3/5
Estimated time
1-2 days
Activity status
Stale
Clarity
Mostly clear
Newbie friendliness
45/100

Get new issues in your inbox

A short digest of beginner-friendly GitHub issues.