Dont' raise an exception when a duplicate event is detected

Bug #485433 reported by Siegfried Gevatter
6
This bug affects 1 person
Affects Status Importance Assigned to Milestone
Zeitgeist Framework
Fix Released
Critical
Mikkel Kamstrup Erlandsen

Bug Description

19:52 <RainCT> thekorn: raising an exception on "Duplicate event detected" is evil
19:53 <RainCT> thekorn: tell me how you want recent.py to work this way
19:53 <thekorn> RainCT, catch this exception
19:54 <RainCT> thekorn: doesn't help, if I'm sending 50 event and event 10 is already there then events 11-50 won't get inserted
19:55 <thekorn> RainCT, ok, so the only problem is when you are importing the existing history?
19:55 <RainCT> thekorn: no, with the current one too, because recent.py doesn't know when the last run was
19:55 <thekorn> RainCT, let's open a "critical" bugreport for it
19:56 <thekorn> this has to be discussed and needs more thoughts
19:56 <RainCT> (we should workaround that in some way but still the Zeitgeist API not allowing this is a problem)

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

after thinking about it I think we should drop raising the KeyError.
Instead this we should return the id of the already existing event in the DB.

This way inserting 50 Events will always return a list of 50 ids.

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

For duplicate events this I think that Markus' proposal is OK. But do we have any other error scenarios when inserting events? What is the solution in this case then?

Revision history for this message
Seif Lotfy (seif) wrote : Re: [Bug 485433] Re: Dont' raise an exception when a duplicate event is detected

uhm not really
if u insert 50 events and all are the same do we want to get a list of 50
identical ids or just a list with one id in it?
This is a tough decision but i think the direction is pretty right. we shall
not skip other inserts just because one failed.

2009/11/19 Mikkel Kamstrup Erlandsen <email address hidden>

> For duplicate events this I think that Markus' proposal is OK. But do
> we have any other error scenarios when inserting events? What is the
> solution in this case then?
>
> --
> Dont' raise an exception when a duplicate event is detected
> https://bugs.launchpad.net/bugs/485433
> You received this bug notification because you are subscribed to The
> Zeitgeist Project.
>
> Status in Zeitgeist Engine: New
>
> Bug description:
> 19:52 <RainCT> thekorn: raising an exception on "Duplicate event detected"
> is evil
> 19:53 <RainCT> thekorn: tell me how you want recent.py to work this way
> 19:53 <thekorn> RainCT, catch this exception
> 19:54 <RainCT> thekorn: doesn't help, if I'm sending 50 event and event 10
> is already there then events 11-50 won't get inserted
> 19:55 <thekorn> RainCT, ok, so the only problem is when you are importing
> the existing history?
> 19:55 <RainCT> thekorn: no, with the current one too, because recent.py
> doesn't know when the last run was
> 19:55 <thekorn> RainCT, let's open a "critical" bugreport for it
> 19:56 <thekorn> this has to be discussed and needs more thoughts
> 19:56 <RainCT> (we should workaround that in some way but still the
> Zeitgeist API not allowing this is a problem)
>
>

Revision history for this message
Siegfried Gevatter (rainct) wrote :

2009/11/20 Seif Lotfy <email address hidden>:
> if u insert 50 events and all are the same do we want to get a list of 50
> identical ids or just a list with one id in it?

50. The IDs need to be returned in the same position in the lists as
the corresponding event was in the list you passed to InsertEvents
when calling it,

--
Siegfried-Angel Gevatter Pujals (RainCT)
Free Software Developer 363DEAE3

Revision history for this message
Seif Lotfy (seif) wrote :

OK so what is the status on this bug! Shal lwe just return the id of the event that is already inserted?

Changed in zeitgeist:
importance: Critical → Medium
importance: Medium → Critical
status: New → Triaged
assignee: nobody → Seif Lotfy (seif)
Revision history for this message
Mikkel Kamstrup Erlandsen (kamstrup) wrote :

I'll do this tonight, and update the unit tests accordingly

Changed in zeitgeist:
assignee: Seif Lotfy (seif) → Mikkel Kamstrup Erlandsen (kamstrup)
Revision history for this message
Mikkel Kamstrup Erlandsen (kamstrup) wrote :

Fixed in revision #1157

Changed in zeitgeist:
status: Triaged → 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.