zim-desktop-wiki / zim-desktop-wiki

Main repository of the zim desktop wiki project
http://zim-wiki.org
GNU General Public License v2.0
1.96k stars 369 forks source link

TaskList crashes #2635

Open amirsobhi opened 4 months ago

amirsobhi commented 4 months ago

Describe the bug Click on the TaskList button or use TaskList from the View menu item crashes the operation and traceback window appears.

To Reproduce Click on the TaskList button or use TaskList from the View menu item crashes the operation

Expected behavior The TaskList should display my tasks are they are marked in the main ZimWiki pages.

Screenshots This is the text of the traceback:

Looks like you found a bug - When reporting this bug please include the information from the text box below

This is zim 0.75.2 Platform: posix Locale: en_US UTF-8 FS encoding: utf-8 Python: (3, 11, 9, 'final', 0) PyGObject: (3, 46, 0)

======= Traceback ======= File "/app/lib/python3.11/site-packages/zim/actions.py", line 159, in _on_activate self.call() File "/app/lib/python3.11/site-packages/zim/actions.py", line 130, in call return self._action.func(self._instance, *args, *kwargs) ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^ File "/app/lib/python3.11/site-packages/zim/plugins/tasklist/init.py", line 172, in show_task_list self._task_list_window = self._show_task_window(selection_state=None, hide_on_close=True) ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^ File "/app/lib/python3.11/site-packages/zim/plugins/tasklist/init.py", line 181, in _show_task_window window = TaskListWindow(notebook, index, navigation, properties, self.plugin.preferences['show_inbox_next'], hide_on_close=True) ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^ File "/app/lib/python3.11/site-packages/zim/plugins/init.py", line 111, in _init_wrapper orig_init(self, arg, **kwarg) File "/app/lib/python3.11/site-packages/zim/plugins/tasklist/gui.py", line 429, in init self._init_selection_state() File "/app/lib/python3.11/site-packages/zim/plugins/tasklist/gui.py", line 119, in _init_selection_state self._set_selection_state(state) File "/app/lib/python3.11/site-packages/zim/plugins/tasklist/gui.py", line 126, in _set_selection_state self.selection_list._select(state[0]) File "/app/lib/python3.11/site-packages/zim/plugins/tasklist/gui.py", line 612, in _select raise AssertionError("Could not find key: %s" % key) AssertionError: Could not find key: projects

Environment (please complete the following information):

Additional context None

For issues triggered by specific page content, please add an (anonymized) example that allows reproducing this issue.

For issues with no visible output / error, check the debug log for additional logging. This is available via the menu or by running "zim -D" from the commandline.

jaap-karssenberg commented 4 months ago

Looks like somehow the state cache got out of sync. Should patch this with simple "catch" of such errors in the intialization.

Work around might be to clear the "state.conf" cache for this notebook - typically this can be found in "~/.cache/zim/...notebook.../"