Gentoo Websites Logo
Go to: Gentoo Home Documentation Forums Lists Bugs Planet Store Wiki Get Gentoo!
Bug 774732 - app-misc/khal-0.10.2: ikhal - deleting instances of recurring event yields AssertionError
Summary: app-misc/khal-0.10.2: ikhal - deleting instances of recurring event yields As...
Status: UNCONFIRMED
Alias: None
Product: Gentoo Linux
Classification: Unclassified
Component: Current packages (show other bugs)
Hardware: All Linux
: Normal normal (vote)
Assignee: Amy Liffey
URL: https://github.com/pimutils/khal/issu...
Whiteboard:
Keywords: PATCH
Depends on:
Blocks:
 
Reported: 2021-03-07 21:07 UTC by oneone
Modified: 2021-03-08 00:22 UTC (History)
1 user (show)

See Also:
Package list:
Runtime testing required: ---


Attachments

Note You need to log in before you can comment on or make changes to this bug.
Description oneone 2021-03-07 21:07:37 UTC
app-misc/khal-0.10.2 yields AssertionError as described in issue #793 on GitHub (https://github.com/pimutils/khal/issues/793), when trying to delete an instance of a recurring event in ikhal.

Reproducible always.

Suggested workaround:

diff --git a/khal/ui/__init__.py b/khal/ui/__init__.py
index d0efa68..395c450 100644
--- a/khal/ui/__init__.py
+++ b/khal/ui/__init__.py
@@ -1101,6 +1101,7 @@ class ClassicView(Pane):
             account, href, etag = part.split('\n', 2)
             event = self.collection.get_event(href, account)
             event.delete_instance(rec_id)
+            event.etag = etag
             self.collection.update(event)

     def keypress(self, size, key):


Reproducible: Always

Steps to Reproduce:
1. Create a recurring event.
2. Open ikhal and delete one instance.
3. Close ikhal.
Actual Results:  
ikhal exits with the following error:

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

When starting ikhal again, the instance of the recurring event to be deleted is still there.

Expected Results:  
ikhal closes without an error and the instance of the event is deleted successfully.