Looked into the bug when pressing E and R together in filtered deck

Took a short look into the bug discussed here: Anki 2.1.43 Beta - #10 by dae

When you empty deck, in webview.py load_ts_page("congrats") is called. Which calls this function:

class AnkiWebView:
    def inject_dynamic_style_and_show(self):
        self.evalWithCallback("...", self.show)

And that is where the race condition happens. If the page goes to rebuilt-deck page before the callback is called, the callback and self.show() never runs. (deck rebuilding doesn’t call self.show()) So the page remains hidden.

No idea if this will help, but figured since I’ve already investigated this much, I’d write it anyway. I was actually planning to write a fix, but the webview.py code has changed so much that I’m afraid any fix I write is probably going to create more bugs :smile:

2 Likes

Figuring out what was causing it was the hard part. I’ve pushed a trivial fix to git; presumably that solves it?

1 Like

Yep, that fixed it!