Bug 188769 - Ktimetracker history export and editing broken
Summary: Ktimetracker history export and editing broken
Status: RESOLVED FIXED
Alias: None
Product: ktimetracker
Classification: Applications
Component: general (show other bugs)
Version: unspecified
Platform: unspecified Linux
: NOR normal
Target Milestone: ---
Assignee: Thorsten Staerk
URL:
Keywords:
: 236781 238164 (view as bug list)
Depends on:
Blocks:
 
Reported: 2009-04-03 23:10 UTC by zijdenbos
Modified: 2016-03-02 09:35 UTC (History)
4 users (show)

See Also:
Latest Commit:
Version Fixed In:


Attachments
ktimetracker .ics file (6.70 KB, text/plain)
2009-05-08 16:04 UTC, zijdenbos
Details
ktimetracker test history export (66 bytes, text/plain)
2009-05-08 16:05 UTC, zijdenbos
Details
A sample .ics file for illustrating bogus time exportation (7.95 KB, text/plain)
2009-05-08 17:00 UTC, Eric
Details

Note You need to log in before you can comment on or make changes to this bug.
Description zijdenbos 2009-04-03 23:10:09 UTC
Version:           4.2.0 (using 4.2.2 (KDE 4.2.2), Kubuntu packages)
Compiler:          cc
OS:                Linux (x86_64) release 2.6.28-11-generic

I have been using karm for a long time, and upgraded last month to KDE4.2, which ships with ktimetracker. However, it appears that the history export and editing functions of ktimetracker are seriously broken.

To make sure this was not due to a corrupted .ics file, I started with an empty ktimetracker.ics, created a few tasks, let them run; edited a few (adding time to them). When I export the history, the export reports all sorts of wrong values, including negative ones, but most importantly, it seems to have lost a lot of recorded time (note that the time totals in the main window are in fact correct). Similarly, the history editor at the moment only shows me 4 entries, whereas I have already accumulated time in 7 tasks. Time I recorded or edited recently (today), is not reflected in the history at all.

In short, the history export and editing functions appear to be severely broken in ktimetracker, which renders it essentially useless (to me).

As a minor side note, karm used to contain a clear record of the task hierarchy in the last set of columns, whereas ktimetracker has 'flattened' this to a single, first column, thus losing the task hierarchy in the history export (noted in another bug report as well).
Comment 1 Thorsten Staerk 2009-04-04 16:10:19 UTC
One thing per time - which is this other bug report that says that "karm used to contain a clear record of the task hierarchy in the last set of columns, whereas ktimetracker has 'flattened' this to a single, first column, thus losing the task hierarchy in the history export"

I cannot see what you describe - I still see the task hierarchy, but I never needed a column for it.
Comment 2 zijdenbos 2009-04-04 16:34:05 UTC
I was referring to bug #182502, which to me read as the same issue (but it may not have been). Note that I am referring to an exported history csv file, not the ktimetracker gui.

In the past (karm), exporting the history to csv would give a column labeled Task Hierarchy" at the end, where every subtask would be in the next column over. E.g., the csv would contain:

,,,0.00,0.00,,"TopLevelTask"
,,,0.00,0.00,,,"SubTask"

Btw, I just noted this as a change from the way karm used to work; I believe I would actually prefer a single column, provided that the task hierarchy is still clear (e.g., I might have "Admin" as a subtask of 6 higher-level tasks, which are currently not differentiated explicitly). Some possible solutions are already discussed in Bug 182502.

But I have to admit that tis is something I can easily live with; the fact that the hours reported in the history output are wrong is a much bigger problem imho.
Comment 3 zijdenbos 2009-05-04 16:22:28 UTC
Just wondering whether an update that fixes the history export bug might be released at some point? From what I can tell ktimetracker reports accumulated time correctly in its main window, but I have not been able to get any useful information out of the history export (which seems fairly essential to me). The problem is very easy to reproduce, but I am happy to supply an ics file that demonstrates the problem if that would be of any help.
Comment 4 Eric 2009-05-07 16:05:31 UTC
I have the same problem (v4.2.0). Even for a single task, the exported history will be totally wrong if I happened to close my session while a task was running: the time elapsed between logoff and logon will be added in exported history even though I don't see it happen in the application GUI. I have to think to stop the tasks every time before I logoff, which is a real bummer.
Comment 5 Thorsten Staerk 2009-05-08 12:55:02 UTC
Then please add an .ics file to reproduce.
Comment 6 zijdenbos 2009-05-08 16:04:06 UTC
Created attachment 33469 [details]
ktimetracker .ics file
Comment 7 zijdenbos 2009-05-08 16:05:06 UTC
Created attachment 33470 [details]
ktimetracker test history export
Comment 8 zijdenbos 2009-05-08 16:06:04 UTC
Easy, see attached. The problem seems to arise (at least) when time for a task is added or subtracted, which is something I do frequently (for instance when I have just spent a few hours doing something without a computer, like traveling).

I created two jobs with 3 tasks; let Job1:Task1 run for 9 mins and Job2:Task1 for 5 minutes; then I added (using "Edit Task") 4 hours to Job1:Task2. When you load the attached ics, you will see that these times are correctly shown in the ktimetracker window; however, the 4 hours for Job1:Task2 do not appear at all in the exported history (also attached). 

The "Edit History" window does show an entry for Task2, but its end time is 00:00:00. Also note that in the "Edit History" window one can't dissociate the two Task2's as the task hierarchy, and that the exported history doesn't show totals for each job.
Comment 9 Eric 2009-05-08 17:00:44 UTC
Created attachment 33472 [details]
A sample .ics file for illustrating bogus time exportation

Here is an example of a .ics file showing the "logoff lag phenomenon". I forgot to stop the single task before logging off on May 1st, then I didn't logon again until May 7th. When I export the history, we can see that I worked 18 hours on May 1st, then 24 hours each day afterwards until May 7th...
Comment 10 zijdenbos 2009-05-08 17:06:38 UTC
I have experienced this as well; I think the problem is that when the user starts his/her session again, the timer for tasks that were running when the session was closed before (at logoff) continue to run. All tasks should really be stopped at logoff.
Comment 11 rubberglove 2010-03-05 00:19:32 UTC
I've noticed this problem quite a lot using ktimetracker (it used to work previously). 

It does appear to happen when the history is edited manually.

To replicate:
1. create a new fresh ics file (file->new) and save it
2. create a new task 'test task' and run it for a minute or so
3. export history (file->export history), to clipboard and paste into a text editor. (should give something like: test task,0.02
4. manually edit the timing history of 'test task' to add an hour (right click on 'test task'->edit, 'edit times', modify start time by decrementing the hour by one)
5. export history (file->export history), to clipboard and paste into a text editor. will give something like: test task,-3.98

The expected result would be: test task,1.02

Is this enough to move this bug into 'CONFIRMED'? I also have the .ics files from before/after the change. 

This kind of behaviour makes ktimetracker almost un-usable for me, since I tend to edit times manually a lot (if I forget to hit start/stop, etc).
Comment 12 Thorsten Staerk 2011-10-03 15:15:24 UTC
Oh right, thanks for the report. This has everything to do with Bug 245043: The end time of an event was originally saved in UTC, the start time in the current local time zone. Confirmed, I have to dig into this.
Comment 13 Thorsten Staerk 2011-10-03 15:43:35 UTC
Git commit d96b1393e2fb03a82871a70fbf17c27540bfb834 by Thorsten Staerk.
Committed on 03/10/2011 at 17:43.
Pushed by tstaerk into branch 'master'.

Do not add UTC difference when exporting history.
BUGS:188769,210905
CCBUGS:245043

M  +4    -7    ktimetracker/timetrackerstorage.cpp

http://commits.kde.org/kdepim/d96b1393e2fb03a82871a70fbf17c27540bfb834
Comment 14 Thorsten Staerk 2011-10-03 16:31:17 UTC
*** Bug 238164 has been marked as a duplicate of this bug. ***
Comment 15 Thorsten Staerk 2011-10-13 08:22:04 UTC
*** Bug 236781 has been marked as a duplicate of this bug. ***
Comment 16 Alexander 2016-03-02 09:35:29 UTC
It seems that the issue is still there if you manually edit the times.