GothenburgBitFactory / GothenburgBitFactory/taskwarrior

Task active time is not calculated based on start-Timestamp

Open
#2,210 1 comment 0 reactions 0 assignees View on GitHub
Dominant language
C++
Stars
6.1k
Forks
423
Avg merge
1d 19h
Merged PRs (30d)
11

Description

Sometimes it makes sense to specify a `start` timestamp different from "now". For example when one worked for 30 min on something and then uses `modify start:-30min` to start the task 30 min in the past.
The task duration is not calculated correctly on these entries.

For example I just ran `task 123 mod start:18:10-1d && task 123 done` which resulted in
```
2019-09-11 19:40:00 Start deleted (duration: PT0S).
End set to '2019-09-11 19:40:00'.
Status changed from 'pending' to 'completed'.
```

zero seconds. This is incorrect.

I assume that the wrong task attribute is used to calculate the duration of a task.

#### Reproduction

* Example command:
```
task add Do the thing && task 123 mod start:-30min && sleep 2 && task 123 done
```

* What did you expect to happen?
The task has a calculated duration of 30 minutes and 2 seconds.

* What actually happened?
The task has a calculated duration of 2 seconds.

* Paste the output of the ```task diag``` command.

```
task 2.5.1
Platform: Linux

Compiler
Version: 8.2.0
Caps: +stdc +stdc_hosted +LP64 +c8 +i32 +l64 +vp64 +time_t64
Compliance: C++11

Build Features
CMake: 3.13.4
libuuid: libuuid + uuid_unparse_lower
libgnutls: 3.6.6
Build type: None

Configuration
File: /home/user01/.taskrc (found), 4096 bytes, mode 100644
Data: /home/user01/.task (found), dir, mode 40755
Locking: Enabled
GC: Enabled
Server:
Trust: strict
Certificate: , not readable, 0 bytes
Key: , not readable, 0 bytes
Ciphers: NORMAL
Creds:

Hooks
System: Enabled
Location: /home/user01/.task/hooks
(-none-)

Tests
$TERM: xterm-256color (206x115)
Dups: Scanned 1024 tasks for duplicate UUIDs:
Found duplicate 21f10f57-97d0-46c8-8e08-2faa3c76b8cb
Broken ref: Scanned 1024 tasks for broken references:
No broken references found
```
Apparently I generated the same UUID twice? I don't think that's possible...

Meanwhile I'm used to this specific bug. It's dangerous to get used to incorrect program behaviour.

Contributor guide

Open the contributing guide

Assessment

This issue has not been assessed yet.

Get new issues in your inbox

A short digest of beginner-friendly GitHub issues.