After an evaluation, GNOME has moved from Bugzilla to GitLab. Learn more about GitLab.
No new issues can be reported in GNOME Bugzilla anymore.
To report an issue in a GNOME project, go to GNOME GitLab.
Do not go to GNOME Gitlab for: Bluefish, Doxygen, GnuCash, GStreamer, java-gnome, LDTP, NetworkManager, Tomboy.
Bug 574334 - [trunk] Facts spanning intervals are not handled correctly
[trunk] Facts spanning intervals are not handled correctly
Status: RESOLVED FIXED
Product: hamster-applet
Classification: Deprecated
Component: general
unspecified
Other All
: Normal normal
: ---
Assigned To: hamster-applet-maint
hamster-applet-maint
Depends on:
Blocks:
 
 
Reported: 2009-03-06 01:06 UTC by Hendrik van Antwerpen
Modified: 2009-03-06 08:56 UTC
See Also:
GNOME target: ---
GNOME version: 2.23/2.24


Attachments
Patch fixing the selecting SQL query. (561 bytes, patch)
2009-03-06 01:06 UTC, Hendrik van Antwerpen
none Details | Review

Description Hendrik van Antwerpen 2009-03-06 01:06:01 UTC
Please describe the problem:
The function __get_interval_activity_ids in db.py omits activities which start outside the given period but end in it (or even pass it). This because only the start_time is checked to be in the given period.
It's better to check if the fact doesn't start after the period ends and doesn't end before the period starts. This way all facts overlapping the period will be matched.

Steps to reproduce:
1. Create a fact which starts on saturday and ends on sunday. The fact has to have an activity not already present in the weeks it's in.
2. Switch to week view
3. Go to the week where the event ends
4. Go back one week, to the week where the event starts

Actual results:
An exception occurs, about the activity not being in an array (in stats.db). The graph is not updated. This was because __get_interval_activity_ids didn't return all activities needed for totalling hours.

Expected results:
The graph is updated for the week you switch too.

Does this happen every time?
Yes

Other information:
Comment 1 Hendrik van Antwerpen 2009-03-06 01:06:58 UTC
Created attachment 130166 [details] [review]
Patch fixing the selecting SQL query.
Comment 2 Toms Bauģis 2009-03-06 08:56:09 UTC
Well spotted, Hendrik!

Actually there is more, hehe - since we are looking on tasks that can span both, over the previous and next day, then simple start_time > span_start and end_time < span_end won't do the job:

xxx would fail under start_time > span_start and yyy would fail under end_time < span_end:

[----------xxx|xxx--------TODAY-----------yyy|yyy-----------]


So, instead we check for both dates. That is - if start time is in our interval, then we will catch activity yyy. But if end time is in interval - activity xxx.
Cool, innit?

Committed your patch with the mentioned adjustments, hooray!