fix: normalize task IDs to numbers on load to fix comparison issues
- Added normalizeTaskIds function to convert string IDs to numbers - Applied normalization in readJSON for all code paths - Fixed set-task-status, add-task, and move-task to normalize IDs when working with raw data - Exported normalizeTaskIds function for use in other modules - Added test case for string ID normalization 🤖 Generated with [Claude Code](https://claude.ai/code) Co-Authored-By: Claude <noreply@anthropic.com>
This commit is contained in:
committed by
Ralph Khreish
parent
077cbb99de
commit
ef23beac0d
@@ -1,5 +1,5 @@
|
||||
import path from 'path';
|
||||
import { log, readJSON, writeJSON, setTasksForTag } from '../utils.js';
|
||||
import { log, readJSON, writeJSON, setTasksForTag, normalizeTaskIds } from '../utils.js';
|
||||
import { isTaskDependentOn } from '../task-manager.js';
|
||||
import generateTaskFiles from './generate-task-files.js';
|
||||
|
||||
@@ -79,6 +79,8 @@ async function moveTask(
|
||||
|
||||
// Get the tasks for the current tag
|
||||
const tasks = rawData[tag].tasks;
|
||||
|
||||
normalizeTaskIds(tasks);
|
||||
|
||||
log(
|
||||
'info',
|
||||
|
||||
Reference in New Issue
Block a user