pimutils / khal

:calendar: CLI calendar application
https://lostpackets.de/khal/
MIT License
2.54k stars 198 forks source link

ikhal won't delete single instance of recurring event #1286

Closed esthet1cs closed 11 months ago

esthet1cs commented 12 months ago

When trying to delete a single instance of a recurring event, ikhal throws an error after being closed and the instance does not get deleted. Deleting all instances of a recurring event works fine.

ikhal throws the following errors:

Traceback (most recent call last):
  File "/usr/lib/python3/dist-packages/khal/ui/__init__.py", line 1365, in start_pane
    loop.run()
  File "/usr/lib/python3/dist-packages/urwid/main_loop.py", line 287, in run
    self._run()
  File "/usr/lib/python3/dist-packages/urwid/main_loop.py", line 385, in _run
    self.event_loop.run()
  File "/usr/lib/python3/dist-packages/urwid/main_loop.py", line 790, in run
    self._loop()
  File "/usr/lib/python3/dist-packages/urwid/main_loop.py", line 827, in _loop
    self._watch_files[fd]()
  File "/usr/lib/python3/dist-packages/urwid/raw_display.py", line 416, in <lambda>
    wrapper = lambda: self.parse_input(
                      ^^^^^^^^^^^^^^^^^
  File "/usr/lib/python3/dist-packages/urwid/raw_display.py", line 515, in parse_input
    callback(processed, processed_codes)
  File "/usr/lib/python3/dist-packages/urwid/main_loop.py", line 412, in _update
    self.process_input(keys)
  File "/usr/lib/python3/dist-packages/urwid/main_loop.py", line 519, in process_input
    something_handled |= bool(self.unhandled_input(k))
                              ^^^^^^^^^^^^^^^^^^^^^^^
  File "/usr/lib/python3/dist-packages/urwid/main_loop.py", line 565, in unhandled_input
    return self._unhandled_input(input)
           ^^^^^^^^^^^^^^^^^^^^^^^^^^^^
  File "/usr/lib/python3/dist-packages/khal/ui/base.py", line 205, in on_key_press
    self.backtrack()
  File "/usr/lib/python3/dist-packages/khal/ui/base.py", line 190, in backtrack
    cb(data)
  File "/usr/lib/python3/dist-packages/khal/ui/__init__.py", line 1119, in cleanup
    self.collection.update(event)
  File "/usr/lib/python3/dist-packages/khal/khalendar/khalendar.py", line 170, in update
    assert event.etag
AssertionError

The expected behaviour would be that the single instance of the recurring event marked as deleted is deleted, like a regular event would be deleted.

khal, version 0.10.5 Debian Sid khal installed via Debian package management python version 3.11.4

WhyNotHugo commented 11 months ago

There were some fixes related to deleting a single instance in a recurring event some weeks ago.

Your version of khal is pretty old, can you try with the latest release?

esthet1cs commented 11 months ago

Thanks for the info - that worked, the problem has been fixed. And I have learned for next time to try this before opening an issue here. The fix just hasn't made it downstream into the Debian package yet.

I installed khal from the repo into a virtual environment with pip install git+https://github.com/pimutils/khal. That got me version 0.11.3.dev37+g21ee686 . Deleting a single instance of a recurring event works. Thanks again!

Edit: Debian Unstable already has the latest version 0.11.2 that should include the fix.