What to do if an event is not found or blocked when calling GetEvents (or its engine equivalent)

Bug #495392 reported by Markus Korn
6
This bug affects 1 person
Affects Status Importance Assigned to Milestone
Zeitgeist Framework
Fix Released
Critical
Markus Korn

Bug Description

Right now GetEvents raises a KeyError whenever any event is either not found or blocked by an extension. As good as this solution was in case of not found events it turns out to be bad for blocked events.

I think there are two possible solutions:
 * adding a NULLEvent, a somehow designed event datastructure which indicates "cannot find an event (with this id)"
 * raising a KeyError which somehow contains all failing/blocked event-ids. The client can now make another GetEvents call but remove all failing ids from the arguments

If we manage to find a good NULLEvent I think this solution makes the most sense.

Related branches

Markus Korn (thekorn)
Changed in zeitgeist:
milestone: none → 0.3.1
importance: Undecided → Critical
Revision history for this message
Markus Korn (thekorn) wrote :

The attached branch adds a NULL_EVENT to the datamodel.
I think the branch is not ready to be merged yet, still needs some tweaks.
But it should give the general idea of how this could work.
The ZeitgeistClient automatically translates a received NULL_EVENT to None.

Changed in zeitgeist:
assignee: nobody → Markus Korn (thekorn)
status: New → In Progress
Revision history for this message
Siegfried Gevatter (rainct) wrote :

Looks good.

I suppose that just doing «NULL_EVENT = ([], [], ")» instead of all this D-Bus fuss didn't work?

Also, personally I'd change:
=====
if event is None:
    continue
event._make_dbus_sendable()
=====
to:
=====
if event:
    event._make_dbus_sendable()
=====
But this is just nitpicking and it's up to you :).

Revision history for this message
Markus Korn (thekorn) wrote :

I addressed both your comments in revision 1225, thanks for the review.

Revision history for this message
Mikkel Kamstrup Erlandsen (kamstrup) wrote :

I think it looks good. The primary missing point is documentation. The DBus API needs to be documented in this regard. This also holds for the recent change with event id 0 indicates an error.

It's ok to merge without it. If you don't get around to this it's ok - I'll try to remember doing it before the release if not.

Revision history for this message
Markus Korn (thekorn) wrote :

I just added documentation for both NULL_EVENT and 0 in GetEvents results.

Revision history for this message
Markus Korn (thekorn) wrote :

Based on the feedback and the fact I added docs I decided to merge the changes into lp:zeitgeist as I need this for another fix I'm working on right now (bug 462894)
------------------------------------------------------------
revno: 1226 [merge]
committer: Markus Korn <email address hidden>
branch nick: trunk
timestamp: Mon 2009-12-14 10:30:48 +0100
message:
  * If GetEvents is called with an event id which does either not exist or is
    blocked a NULL_EVENT struct is returned (LP: #495392)
  * Documented this behaviour and also the fix for bug 495179
------------------------------------------------------------

Markus Korn (thekorn)
Changed in zeitgeist:
status: In Progress → Fix Committed
Changed in zeitgeist:
status: Fix Committed → Fix Released
To post a comment you must log in.
This report contains Public information  
Everyone can see this information.

Other bug subscribers

Remote bug watches

Bug watches keep track of this bug in other bug trackers.