GothenburgBitFactory / taskwarrior

Taskwarrior - Command line Task Management
https://taskwarrior.org
MIT License
4.27k stars 282 forks source link

Taskwarrior and Timewarrior not integrating #2565

Open jakec-dev opened 3 years ago

jakec-dev commented 3 years ago

To report a bug...

cp /usr/share/doc/timew/ext/on-modify.timewarrior ~/Documents/Sync/.task/hooks/on-modify.timewarrior

task diagnostics

This returns (in the hooks section):

Hooks
     System: Enabled
   Location: /home/jake/Documents/Sync/.task/hooks
     Active: on-add.blocks_attr.py    (executable) (symlink)
             on-launch.blocks_attr.py (executable) (symlink)
             on-modify.blocks_attr.py (executable)
             on-modify.timewarrior    (executable)
   Inactive: 

task add test task task +LATEST start

This returns:

Starting task <id> 'test task'.
Started 1 task.

task _get $(task +LATEST uuids).start

This returns the current timestamp.

timew

This returns:

There is no active time tracking

Timewarrior and Taskwarrior integration.

No integration.

~ > task diag
TASKRC override: /home/jake/.config/task/taskrc
TASKDATA override: /home/jake/Documents/Sync/.task

task 2.5.3
   Platform: Linux

Compiler
    Version: 10.2.0
       Caps: +stdc +stdc_hosted +LP64 +c8 +i32 +l64 +vp64 +time_t64
 Compliance: C++17

Build Features
      Built: Feb  2 2021 23:45:39
      CMake: 3.19.4
    libuuid: libuuid + uuid_unparse_lower
  libgnutls: 3.7.0
 Build type: 

Configuration
       File: /home/jake/.config/task/taskrc (found), 4920 bytes, mode 100644
       Data: /home/jake/Documents/Sync/.task (found), dir, mode 40755
     TASKRC: /home/jake/.config/task/taskrc
   TASKDATA: /home/jake/Documents/Sync/.task
    Locking: Enabled
         GC: Enabled
    $VISUAL: vim
     Server: 
         CA: -
Certificate: -
        Key: -
      Trust: strict
    Ciphers: NORMAL
      Creds: 

Hooks
     System: Enabled
   Location: /home/jake/Documents/Sync/.task/hooks
     Active: on-add.blocks_attr.py    (executable) (symlink)
             on-launch.blocks_attr.py (executable) (symlink)
             on-modify.blocks_attr.py (executable)
             on-modify.timewarrior    (executable)
   Inactive: 

Tests
   Terminal: 210x42
       Dups: Scanned 623 tasks for duplicate UUIDs:
             No duplicates found
 Broken ref: Scanned 623 tasks for broken references:
             No broken references found

Output of timew diagnostics:

timew 1.4.3
       Platform: Linux

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

Build Features
          Built: Jun 23 2021 08:10:20
          CMake: 3.20.5
     Build type: release

Configuration
  TIMEWARRIORDB: /home/jake/Documents/Sync/.time
            Cfg: /home/jake/Documents/Sync/.time/timewarrior.cfg (-rw- 55 bytes)
       Database: /home/jake/Documents/Sync/.time (drwx 4096 bytes)
        $VISUAL: vim
    Color theme: dark_blue.theme: A dark blue theme.
                 00 01 02 03 04 05 06 07 08 09 10 11 12 13 14 15
                 16 17 18 19 20 21 22 23 24 25 26 27 28 29 30 31
                 32 33 34 35 36 37 38 39 40 41

Extensions
       Location: /home/jake/Documents/Sync/.time/extensions (drwx 4096 bytes)
                 /home/jake/Documents/Sync/.time/extensions/totals.py (-rwx 5440 bytes)

Output of env | grep -e TASK -e TIMEWARRIOR:

TASKDATA=/home/jake/Documents/Sync/.task
TASKRC=/home/jake/.config/task/taskrc
TIMEWARRIORDB=/home/jake/Documents/Sync/.time
tbabej commented 3 years ago

Nothing strikes me as wrong in this setup. Perhaps add a debugging print to ~/Documents/Sync/.task/hooks/on-modify.timewarrior, which is just a Python script, in order to determine whether its actually being run?

jakec-dev commented 3 years ago

I'm not very experienced with Python. Do you happen to know what I should add to the script to be able to debug what the issue is?

jakec-dev commented 3 years ago

I just noticed that if I run timew summary it shows that the integration appears to be working, however it seems to automatically start a task at midnight and doesn't stop it until I manually start a different task myself.

E.g, here's the output for today:

~ > timew summary

Wk  Date       Day Tags                                                                    Start      End    Time    Total
W32 2021-08-09 Mon Clear task inbox, next                                                0:00:00  9:15:28 9:15:28
                   create systemd service and timer for arch-rss auto-task, inbox        9:15:28  9:28:26 0:12:58
                   @call, @phone, Call Medicare on 132 011 about new card, next          9:41:51 10:21:19 0:39:28 10:09:02                                                                                        
                                                                                                                  10:09:02

My computer was turned off until approx 8am this morning so I have no idea how the 'Clear task inbox' task is automatically starting at midnight each day. I did start that task today however it was at approximately 8:15am, not midnight.

It almost seems as if Timewarrior is using the scheduled attribute (which is midnight every day for the 'clear task inbox' task) as the start time rather than the actual time I start the task, and this is causing the other issues I experienced.

noelzubin commented 3 years ago

Looks like the on-modify hook does not get call on task stop <id> anymore.