Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Multiline UDAs broken #2645

Open
thehunmonkgroup opened this issue Oct 20, 2021 · 13 comments
Open

Multiline UDAs broken #2645

thehunmonkgroup opened this issue Oct 20, 2021 · 13 comments
Labels
eval:reproduced type:bug Something isn't working
Milestone

Comments

@thehunmonkgroup
Copy link
Contributor

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 ?

@tbabej tbabej added eval:reproduced type:bug Something isn't working labels Oct 21, 2021
@tbabej tbabej added this to the 2.6.2 milestone Oct 22, 2021
@tbabej
Copy link
Member

tbabej commented Nov 9, 2021

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

[warrior@tw-v2.5.3 ~]$ task add test notes:"one
> two
> three"
Created task 2.
[warrior@tw-v2.5.3 ~]$ 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

[warrior@tw-v2.5.3 ~]$ 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
Copy link
Member

tbabej commented Nov 9, 2021

(same problem occurs on 2.5.1)

@thehunmonkgroup
Copy link
Contributor Author

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.

@tbabej
Copy link
Member

tbabej commented Nov 9, 2021

@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 🤔

@tbabej
Copy link
Member

tbabej commented Nov 9, 2021

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

@thehunmonkgroup
Copy link
Contributor Author

Perhaps bisect from #2132 ?

@tbabej
Copy link
Member

tbabej commented Nov 10, 2021

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 😅

@thehunmonkgroup
Copy link
Contributor Author

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

@tbabej
Copy link
Member

tbabej commented Nov 22, 2021

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?

[warrior@tw-v2.6.1 ~]$ task add test note:"'one
> two
> three
> four
> '"
Created task 1.
[warrior@tw-v2.6.1 ~]$ 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                                

@thehunmonkgroup
Copy link
Contributor Author

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
Copy link
Contributor Author

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: thehunmonkgroup/onenote#3

@tbabej
Copy link
Member

tbabej commented Dec 22, 2021

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?

@thehunmonkgroup
Copy link
Contributor Author

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 added a commit to thehunmonkgroup/onenote that referenced this issue Feb 7, 2024
Fixes address the bug reported at GothenburgBitFactory/taskwarrior#2645

OneNote should now work properly with Taskwarrior versions 2.5.x and 2.6.x
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
eval:reproduced type:bug Something isn't working
Projects
None yet
Development

No branches or pull requests

2 participants