taskwarrior icon indicating copy to clipboard operation
taskwarrior copied to clipboard

Project filter with datetime attribute name (i.e. project:scheduled) is parsed as project:

Open Kevin-Mok opened this issue 6 years ago • 2 comments

To report a bug...

  • What command(s) did you run? task project:sch
  • What did you expect to happen? For tasks with project sch to show.
    ID Age Project Tag  Due Description                  Urg 
     3 2d  sch     next 3d  update/upgrade/backup laptop   30
    14 1d  sch     324  3d  watch Racket/Haskell vids      15
    
  • What actually happened? Tasks without a project showed. When I reverted back to commit 8b4ae3b54 (v2.5.1), the output was as expected.
    ID Age   P Description                Urg
    11  1d   H change gov. card addresses 6.01
    26 10h     setup Buku on phone           1
    
  • Paste the output of the task diag command (v.2.6.0).
    task 2.6.0
       Platform: Linux
    
    Compiler
        Version: 9.1.0
           Caps: +stdc +stdc_hosted +LP64 +c8 +i32 +l64 +vp64 +time_t64
     Compliance: C++14
    
    Build Features
          Built: Sep  5 2019 11:39:46
         Commit: cad8bec8b
          CMake: 3.15.1
        libuuid: libuuid + uuid_unparse_lower
      libgnutls: 3.6.9
     Build type: release
    
    Configuration
           File: /home/kevin/.taskrc (found), 2169 bytes, mode 100644
           Data: /home/kevin/.task (found), dir, mode 40755
        Locking: Enabled
             GC: Enabled
        $VISUAL: nvim
         Server: taskd.khkm.tk:53589
             CA: /home/kevin/.task/ca.cert.pem, readable, 3512 bytes
    Certificate: /home/kevin/.task/do.cert.pem, readable, 3553 bytes
            Key: /home/kevin/.task/do.key.pem, readable, 24742 bytes
          Trust: strict
        Ciphers: NORMAL
          Creds: Hevin/Kevin/************************************
    
    Hooks
         System: Enabled
       Location: /home/kevin/.task/hooks
         Active:
       Inactive: on-exit-auto-sync (not executable)
    
    Tests
       Terminal: 210x44
           Dups: Scanned 51 tasks for duplicate UUIDs:
                 No duplicates found
     Broken ref: Scanned 51 tasks for broken references:
                 No broken references found
    
    
  • Paste the output of the task diag command (v.2.5.1).
    task 2.5.1
       Platform: Linux
    
    Compiler
        Version: 9.1.0
           Caps: +stdc +stdc_hosted +LP64 +c8 +i32 +l64 +vp64 +time_t64
     Compliance: C++11
    
    Build Features
          Built: Sep  5 2019 11:48:01
         Commit: 8b4ae3b54
          CMake: 3.15.1
        libuuid: libuuid + uuid_unparse_lower
      libgnutls: 3.6.9
     Build type: release
    
    Configuration
           File: /home/kevin/.taskrc (found), 2169 bytes, mode 100644
           Data: /home/kevin/.task (found), dir, mode 40755
        Locking: Enabled
             GC: Enabled
        $VISUAL: nvim
         Server: taskd.khkm.tk:53589
             CA: /home/kevin/.task/ca.cert.pem, readable, 3512 bytes
          Trust: strict
    Certificate: /home/kevin/.task/do.cert.pem, readable, 3553 bytes
            Key: /home/kevin/.task/do.key.pem, readable, 24742 bytes
        Ciphers: NORMAL
          Creds: Hevin/Kevin/************************************
    
    Hooks
         System: Enabled
       Location: /home/kevin/.task/hooks
         Active:
       Inactive: on-exit-auto-sync (not executable)
    
    Tests
          $TERM: screen-256color (210x44)
           Dups: Scanned 51 tasks for duplicate UUIDs:
                 No duplicates found
     Broken ref: Scanned 51 tasks for broken references:
                 No broken references found
    

Kevin-Mok avatar Sep 05 '19 15:09 Kevin-Mok

Reproduced on 2.6.0.

This seems to happen due to the fact that sch is a prefix of scheduled. Reproducible by any other prefix of scheduled too or other datetime attribute (i.e. project:wait)

What seems to be happening is that project:<datetime attribute name or prefix> gets evaluated into project: (empty value for the project).

If you don't have any default.project configured in your taskrc, you get a list of tasks without a project. If you do have default.project defined, the filter fails with:

$ task project:sch
'Inbox' is not a valid date in the 'Y-M-D' format.

tbabej avatar Dec 06 '20 21:12 tbabej

DOM references should be preserved, however, maybe we could consider not evaluating them if the attribute types are different (as is in this case).

tbabej avatar Jan 30 '21 23:01 tbabej