Bug 335551 - Edit history allows setting end time < start time
Summary: Edit history allows setting end time < start time
Status: REOPENED
Alias: None
Product: ktimetracker
Classification: Applications
Component: general (other bugs)
Version First Reported In: 4.13
Platform: Kubuntu Linux
: NOR major
Target Milestone: ---
Assignee: Zoltan Gyarmati
URL:
Keywords:
Depends on:
Blocks:
 
Reported: 2014-05-29 17:26 UTC by Ed O'Loughlin
Modified: 2019-11-19 03:40 UTC (History)
1 user (show)

See Also:
Latest Commit:
Version Fixed/Implemented In:
Sentry Crash Report:


Attachments

Note You need to log in before you can comment on or make changes to this bug.
Description Ed O'Loughlin 2014-05-29 17:26:05 UTC
It's possible to edit history and set the end time for a task to a time before the start time. This causes the total reported time for the task to be incorrect, even negative.

Reproducible: Always

Steps to Reproduce:
1. Start and stop timing a task.
2. Edit history and set the end time < start time.
Actual Results:  
Allowed end time < start time.

Expected Results:  
Rejected the edit.

It's possible to inadvertently do this very easily. I've done it several times and have had to visually inspect few hundred entries to find the problem entry.
Because of the large effort required to manually fix these problems, I think it's of major severity.
Comment 1 Andrew Crouthamel 2018-09-04 18:53:18 UTC
Hello! Sorry to be the bearer of bad news, but this project has been unmaintained for many years so I will be closing this bug.
Comment 2 Alexander Potashev 2019-06-18 19:29:25 UTC
Git commit 15b5c674f4495ec950c97619f2f2abb534d3c8c5 by Alexander Potashev.
Committed on 18/06/2019 at 19:25.
Pushed by aspotashev into branch 'master'.

event: Update duration on changes in HistoryDialog

Also disallow setting dtEnd earlier than dtStart.

If you try to set dtEnd earlier than dtStart, dtEnd will be
automatically set equal to dtStart.

If you try to set dtStart later than dtEnd, dtStart will be
automatically set equal to dtEnd.

M  +8    -0    src/historydialog.cpp
M  +27   -2    src/model/event.cpp
M  +17   -1    src/model/event.h

https://commits.kde.org/ktimetracker/15b5c674f4495ec950c97619f2f2abb534d3c8c5
Comment 3 Alexander Potashev 2019-06-18 19:30:36 UTC
Left to do: KTimeTracker should notify the user about his/her mistake and that auto-change happens.