- blue for normal sync, red for full sync required
- refactor status fetching code so we don't hold a collection lock
during the network request, which slows things down
- fix sync spinner restarting when returning to deck list
- Use a separate abort handle, as the media sync is running
in the background and we need to be able to target them separately.
The current progress handling is going to need a rethink if we introduce
any other background tasks in the future.
- Roll back the transaction when interrupting.
Also:
- provide a way for the progress handler to skip the throttling so that
we can ensure progress is updated at the end of a stage
- show 'checking' at the end of full sync
Related to: https://github.com/ankitects/anki/pull 529
Ensuring "setNote" is called only once during changing of note type
After debugging the code, every time the cards changes, there are
two stacktraces generated and triggered when note cards change:
calling 1590591251.4621403
File "qt/runanki", line 4, in <module>
File "F:\anki\qt\aqt\__init__.py", line 365, in run
_run()
File "F:\anki\qt\aqt\__init__.py", line 515, in _run
app.exec()
File "F:\anki\qt\aqt\webview.py", line 467, in handler
cb(val)
File "F:\anki\qt\aqt\editor.py", line 477, in <lambda>
self.web.evalWithCallback("saveNow(%d)" % keepFocus, lambda res: callback())
File "F:\anki\qt\aqt\browser.py", line 858, in <lambda>
self.editor.saveNow(lambda: self._onRowChanged(current, previous))
File "F:\anki\qt\aqt\browser.py", line 880, in _onRowChanged
self._renderPreview(True)
File "F:\anki\qt\aqt\browser.py", line 1576, in _renderPreview
self._previewer.render_card(cardChanged)
File "F:\anki\qt\aqt\previewer.py", line 136, in render_card
print('calling', time.time(), "\n", "".join( traceback.format_stack() ) )
calling 1590591251.4766161
File "qt/runanki", line 4, in <module>
File "F:\anki\qt\aqt\__init__.py", line 365, in run
_run()
File "F:\anki\qt\aqt\__init__.py", line 515, in _run
app.exec()
File "F:\anki\qt\aqt\webview.py", line 467, in handler
cb(val)
File "F:\anki\qt\aqt\editor.py", line 453, in oncallback
gui_hooks.editor_did_load_note(self)
File "F:\anki\qt\aqt\gui_hooks.py", line 1168, in __call__
hook(editor)
File "F:\anki\qt\aqt\browser.py", line 887, in onLoadNote
self.refreshCurrentCard(editor.note)
File "F:\anki\qt\aqt\browser.py", line 884, in refreshCurrentCard
self._renderPreview(False)
File "F:\anki\qt\aqt\browser.py", line 1576, in _renderPreview
self._previewer.render_card(cardChanged)
File "F:\anki\qt\aqt\previewer.py", line 136, in render_card
print('calling', time.time(), "\n", "".join( traceback.format_stack() ) )