Gentoo Websites Logo
Go to: Gentoo Home Documentation Forums Lists Bugs Planet Store Wiki Get Gentoo!

Bug 774732

Summary: app-misc/khal-0.10.2: ikhal - deleting instances of recurring event yields AssertionError
Product: Gentoo Linux Reporter: oneone
Component: Current packagesAssignee: Amy Liffey <amynka>
Status: RESOLVED FIXED    
Severity: normal CC: jstein
Priority: Normal Keywords: PATCH
Version: unspecified   
Hardware: All   
OS: Linux   
URL: https://github.com/pimutils/khal/issues/793
Whiteboard:
Package list:
Runtime testing required: ---

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.
Comment 1 Larry the Git Cow gentoo-dev 2022-02-02 15:49:01 UTC
The bug has been closed via the following commit(s):

https://gitweb.gentoo.org/repo/gentoo.git/commit/?id=c5fd35ce0be1729319b73caeb7ee08d47c8712ec

commit c5fd35ce0be1729319b73caeb7ee08d47c8712ec
Author:     Amy Liffey <amynka@gentoo.org>
AuthorDate: 2022-02-02 15:40:18 +0000
Commit:     Amy Liffey <amynka@gentoo.org>
CommitDate: 2022-02-02 15:47:53 +0000

    app-misc/khal: version bump 0.10.4
    
    Closes: https://bugs.gentoo.org/796014
    Closes: https://bugs.gentoo.org/774732
    Package-Manager: Portage-3.0.30, Repoman-3.0.3
    Signed-off-by: Amy Liffey <amynka@gentoo.org>

 app-misc/khal/Manifest                         |  1 +
 app-misc/khal/files/khal-0.10.4-add-etag.patch | 10 ++++++
 app-misc/khal/khal-0.10.4.ebuild               | 45 ++++++++++++++++++++++++++
 3 files changed, 56 insertions(+)