Garbage collection is run after every command
How to reproduce
❯ task list
ID Age Description Urg
1 7s test1 0
2 5s test2 0
3 3s test3 0
3 tasks
❯ task done 1
Completed task 1 'test1'.
Completed 1 task.
❯ task 3 modify priority:H
No tasks specified.
❯ task 2 modify priority:H
Modifying task 2 'test3'.
Modified 1 task.
❯ task list
ID Age P Description Urg
2 39s H test3 6
1 41s test2 0
2 tasks
Expected result
According to https://taskwarrior.org/docs/ids.html renumbering of the tasks should not happen before/after every command, but only before e.g. task list. Task task2 should have been modified to have priority H.
Actual result
Instead renumbering occurs after task done 1/before task 2 modify priority:H and therefore task3 now has ID 2 and gets modified instead.
Diag
❯ task diag
task 2.6.2
Platform: Linux
Compiler
Version: 11.2.0
Caps: +stdc +stdc_hosted +LP64 +c8 +i32 +l64 +vp64 +time_t64
Compliance: C++17
Build Features
CMake: 3.22.3
libuuid: libuuid + uuid_unparse_lower
libgnutls: 3.7.3
Build type:
Configuration
File: /home/user/.taskrc (found), 1400 bytes, mode 100644
Data: /home/user/.task (found), dir, mode 40755
Locking: Enabled
GC: Enabled
$EDITOR: /usr/bin/vim
Server:
CA: -
Certificate: -
Key: -
Trust: strict
Ciphers: NORMAL
Creds:
Hooks
System: Enabled
Location: /home/user/.task/hooks
(-none-)
Tests
Terminal: 120x30
Dups: Scanned 53 tasks for duplicate UUIDs:
No duplicates found
Broken ref: Scanned 53 tasks for broken references:
No broken references found
good catch
Bug report is correct, I was able to reproduce this in a test environment. Neither done or modify should trigger GC, I will have a look into what is going on here :thinking:
I could not reproduce this...
I have this problem as well, on taskwarrior 2.5.1, so the problem is at least that old.