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

Context is not respected by modify command. #3730

Open
rubieking opened this issue Dec 19, 2024 · 6 comments
Open

Context is not respected by modify command. #3730

rubieking opened this issue Dec 19, 2024 · 6 comments
Assignees
Labels
topic:context Issues relatd to context

Comments

@rubieking
Copy link

  • What command(s) did you run?
## Here's the exact set of commands I ran on an empty task warrior instance running 3.2.0 to simulate the issue.
task add main1
task add main2
task context define personal "project:Personal"
task context define work "project:Work"
task context personal
task add p1
task add p2
task context work
task add w1
task add w2
task status:pending modify +testtag
task context none
task list
## Here's the actual output
$ task list

ID Age   Project  Tags    Description Urg
 1 53s            testtag main1        0.8
 2 52s            testtag main2        0.8
 3 43s   Personal testtag p1           1.8
 4 42s   Personal testtag p2           1.8
 5 40s   Work     testtag w1           1.8
 6 39s   Work     testtag w2           1.8

6 tasks
  • What did you expect to happen? What actually happened?
    Modify should respect the context that is set and only update the appropriate items. However, it updates everything. Note that task list works as expected.
  • Paste the output of the task diag command.
$ task diag

task 3.2.0
   Platform: Linux

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

Build Features
     Commit: 7a092bea0
      CMake: 3.28.3
    libuuid: libuuid + uuid_unparse_lower
 Build type: Release

Configuration
       File: /home/ubuntu/.taskrc (found), 950 bytes, mode 100664
       Data: /home/ubuntu/.task (found), dir, mode 40775
         GC: Enabled
Hooks
     System: Enabled
   Location: /home/ubuntu/.task/hooks
             (-none-)

Tests
   Terminal: 324x27
 Broken ref: Scanned 6 tasks for broken references:
             No broken references found
@rubieking
Copy link
Author

I've also identified the fix and it's straightforward. Tested the fix as well. I'd have to look into tests, but happy to take a stab at making a PR assuming the current behavior is not intentional.

@djmitche
Copy link
Collaborator

PRs are great!

@rubieking
Copy link
Author

Thanks, will take a look. Also to add, this seems to be the only one that needs to be fixed. Rest seem to be accurate already.

@djmitche djmitche moved this from Backlog to In progress in Taskwarrior Development Dec 20, 2024
@djmitche
Copy link
Collaborator

I wonder if this is related ti #2917?

@rubieking
Copy link
Author

I looked into it a little bit and I think the issues are different. Primarily, the issue here is trivial and just needs a change in the CmdModify.cpp to update the field _uses_context to true.

#2917 doesn't seem to be the same. Based on my tests, the filtering does work but there seems to be some special cases that need to be looked at in detail. I'll document my findings in a comment in that ticket.

I'm also just about to send out a PR for this one. It contains just the trivial boolean change.

@rubieking
Copy link
Author

Sent out this PR but it seems to have a test/coverage failure. Somehow didn't have any failure on my box when I tried to run tests. I assume I did not run the correct tests.

Will try to look into this and fix tests.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
topic:context Issues relatd to context
Projects
Status: In progress
Development

No branches or pull requests

2 participants