fix: prevent duplicate tasks from :TwAdd - #8
Merged
Conversation
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Add this suggestion to a batch that can be applied as a single commit.This suggestion is invalid because no changes were made to the code.Suggestions cannot be applied while the pull request is closed.Suggestions cannot be applied while viewing a subset of changes.Only one suggestion per line can be applied in a batch.Add this suggestion to a batch that can be applied as a single commit.Applying suggestions on deleted lines is not supported.You must change the existing code in this line in order to create a valid suggestion.Outdated suggestions cannot be applied.This suggestion has been applied or marked resolved.Suggestions cannot be applied from pending reviews.Suggestions cannot be applied on multi-line comments.Suggestions cannot be applied while the pull request is queued to merge.Suggestion cannot be applied right now. Please check back later.
Summary
task addwithrc.verbose=new-uuid:TwAddcommand and<CR>callbackRoot cause
Taskwarrior normally reports a numeric working-set ID (
Created task 1.), whiletw_addonly recognized permanent UUIDs. The firsttask addsucceeded, but UUID extraction returned an empty string. Capture treated that as a failed mutation and ran a second rawtask add, creating a duplicate.The fix makes normal output deterministic using Taskwarrior's automation-oriented
new-uuidverbosity token. It also treats mutation success and output parsing as separate facts: if the command succeeds but no UUID can be extracted, capture warns and does not retry.User impact
:TwAddcreates one task across default and quiet Taskwarrior verbosity settings. Parsed fields such asdue:andproject:remain attached to that single task. Ambiguous successful output no longer causes either a duplicate or a false "add failed" message.Validation
./tests/e2e/run.sh capture_relative_dates_spec.lua— 5 passed./tests/lua/bootstrap.sh— all Lua tests passed4223246Fixes #7