taskwarrior icon indicating copy to clipboard operation
taskwarrior copied to clipboard

Multiline UDAs broken

Open thehunmonkgroup opened this issue 4 years ago • 13 comments

Multiline string UDAs, which worked fine in TaskWarrior 2.5.3 with the addition of #2132 are now broken in latest release:

[:~/git/vit] 2.x+ ± task 1 modify notes:"one"
Modifying task 1 'test'.
Modified 1 task.
TASKRC override: /tmp/tmp.XCtk4fQYjA.vit/taskrc
[:~/git/vit] 2.x+ ± task 1
TASKRC override: /tmp/tmp.XCtk4fQYjA.vit/taskrc
 
Name          Value                               
ID            1                                   
Description   test                                
Status        Pending                             
Entered       2021-10-11 (Mon) (15min)
Last modified 2021-10-11 (Mon) (2s)               
Virtual tags  PENDING READY UDA UNBLOCKED
UUID          a5e07137-2ecb-4372-9e89-422e11aa9068
Urgency          0
Notes         one                                 
 
[:~/git/vit] 2.x+ ± task 1 modify notes:"two
$
$three"
Modifying task 1 'notes:two
 
three'.
Modified 1 task.
TASKRC override: /tmp/tmp.XCtk4fQYjA.vit/taskrc
[:~/git/vit] 2.x+ ± task 1
TASKRC override: /tmp/tmp.XCtk4fQYjA.vit/taskrc
 
Name          Value                               
ID            1                                   
Description   notes:two                           
 
              three                               
Status        Pending                             
Entered       2021-10-11 (Mon) (15min)
Last modified 2021-10-11 (Mon) (2s)               
Virtual tags  PENDING READY UDA UNBLOCKED
UUID          a5e07137-2ecb-4372-9e89-422e11aa9068
Urgency          0
Notes         one 

Possibly related to #2283 ?

thehunmonkgroup avatar Oct 20 '21 13:10 thehunmonkgroup

@thehunmonkgroup I am actually unable to reproduce this working on 2.5.3. Am I doing something incorrectly here?

[[email protected] ~]$ task add test notes:"one
> two
> three"
Created task 2.
[[email protected] ~]$ task 2
No command specified - assuming 'information'.

Name          Value                               
ID            2                                   
Description   test notes:one
              two
              three
Status        Pending                             
Entered       2021-11-09 13:09:07 (2s)
Last modified 2021-11-09 13:09:07 (2s)            
Virtual tags  LATEST PENDING READY UNBLOCKED
UUID          8ebf1352-c91d-4cdd-a05a-ed2938c82da3
Urgency          0

[[email protected] ~]$ task udas

Name     Type   Label    Allowed Values Default Usage Count
notes    string Notes                           0          
priority string Priority H,M,L,                 0

2 UDAs defined

tbabej avatar Nov 09 '21 13:11 tbabej

(same problem occurs on 2.5.1)

tbabej avatar Nov 09 '21 13:11 tbabej

From my initial post:

Multiline string UDAs, which worked fine in TaskWarrior 2.5.3 with the addition of #2132 are now broken in latest release

It's broken in 2.6.1, have not tried HEAD.

thehunmonkgroup avatar Nov 09 '21 22:11 thehunmonkgroup

@thehunmonkgroup Perhaps a misunderstanding. I tested this with 2.6.1 release, 2.5.3 release and 2.5.1 release. The mutli-line UDA, at least according to the above reproduction steps (unless I made a mistake), did not work in any of the releases.

Which obviously seems to be in contrary to your experience (since you've been using this successfully with onenote I'm assuming), hence we need to figure out what's wrong with the reproducer :thinking:

tbabej avatar Nov 09 '21 22:11 tbabej

In other words, I can reproduce the bug, but I can't reproduce a working version, which makes this rather challenging to bisect :sweat_smile:

tbabej avatar Nov 09 '21 23:11 tbabej

Perhaps bisect from #2132 ?

thehunmonkgroup avatar Nov 10 '21 00:11 thehunmonkgroup

Is that the version you suspect you were using? I can try to investigate.

Edit: Now I see what you meant. I misread the original issue description as #2132 causing the problem :sweat_smile:

tbabej avatar Nov 10 '21 00:11 tbabej

For me, the bug is not present on 2.5.3, and is present on all 2.6.x stuff I've tried.

thehunmonkgroup avatar Nov 10 '21 21:11 thehunmonkgroup

I am still unable to reproduce this, but yesterday I discovered that adding additional layer of quoting allows a multi-line value to be parsed correctly. Would that work as a workaround?

[[email protected] ~]$ task add test note:"'one
> two
> three
> four
> '"
Created task 1.
[[email protected] ~]$ task 1 info

Name          Value                               
ID            1                                   
Description   test
Status        Pending                             
Entered       2021-11-22 14:54:31 (2s)
Last modified 2021-11-22 14:54:31 (2s)            
Virtual tags  LATEST PENDING READY UDA UNBLOCKED
UUID          285fb1b5-878c-4849-845e-90858aeb32de
Urgency          0
Note          one                                 
              two                                 
              three                               
              four                                

tbabej avatar Nov 22 '21 14:11 tbabej

I can confirm that your workaround works for both 2.5.3 and the develop branch. Curious why this would be necessary though?

The first quotes should pass the newlines along to TaskWarrior, right?

thehunmonkgroup avatar Nov 22 '21 15:11 thehunmonkgroup

Curious if there's been any progress on this, I'm not really sure what all I can do to help, but I'd be happy to help in any way I can, as this has affected a tool I maintain, and is preventing me from upgrading to 2.6.x: https://github.com/thehunmonkgroup/onenote/issues/3

thehunmonkgroup avatar Dec 20 '21 23:12 thehunmonkgroup

As far as I could tell, this is a consequence of the new parser that was introduced in 2.6 (development branch at the time) and later backported to 2.5.2. Unclear what can be done right now, I tried fixing it but it did not seem straightforward.

Given there is a relatively simple workaround which could be utilized in onenote, and as far as I can tell, is backwards compatible, would going down that path be an option?

tbabej avatar Dec 22 '21 16:12 tbabej

My main concern with the workaround is that it feels brittle, especially given that we can't determine exactly why it's needed. That seems a recipe for another round of bug reports once the root cause is discovered and fixed.

thehunmonkgroup avatar Dec 22 '21 17:12 thehunmonkgroup