fix: use Modifier.Set() to maintain AttributeOrder invariant in API handlers
API handlers were populating SetAttributes directly without appending to AttributeOrder. Since Apply() only iterates AttributeOrder, all updates via PUT/POST were silently dropped — causing edits to revert and tasks to disappear on reload. Adds Modifier.Set() helper, safety net in Apply()/ApplyToNew(), adds description and status to applyNonDateAttribute, and fixes the recurrence->recur key mismatch. Co-Authored-By: Claude Opus 4.6 <noreply@anthropic.com>
This commit is contained in:
@@ -4,14 +4,15 @@ package engine
|
||||
// Used by parseAddArgs (cmd/add.go), ParseFilter, and ParseModifier
|
||||
// to distinguish modifiers from description text.
|
||||
var ValidAttributeKeys = map[string]bool{
|
||||
"due": true,
|
||||
"priority": true,
|
||||
"project": true,
|
||||
"recur": true,
|
||||
"status": true,
|
||||
"wait": true,
|
||||
"scheduled": true,
|
||||
"until": true,
|
||||
"description": true,
|
||||
"due": true,
|
||||
"priority": true,
|
||||
"project": true,
|
||||
"recur": true,
|
||||
"status": true,
|
||||
"wait": true,
|
||||
"scheduled": true,
|
||||
"until": true,
|
||||
}
|
||||
|
||||
// DateKeys is the subset of ValidAttributeKeys that hold date values.
|
||||
|
||||
Reference in New Issue
Block a user