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
@@ -529,6 +529,7 @@ function readJSON(filepath, projectRoot = null, tag = null) {
|
||||
// If anything goes wrong, try to return master or empty
|
||||
const masterData = data.master;
|
||||
if (masterData && masterData.tasks) {
|
||||
normalizeTaskIds(masterData.tasks);
|
||||
return {
|
||||
...masterData,
|
||||
_rawTaggedData: originalTaggedData
|
||||
@@ -1448,5 +1449,6 @@ export {
|
||||
createStateJson,
|
||||
markMigrationForNotice,
|
||||
flattenTasksWithSubtasks,
|
||||
ensureTagMetadata
|
||||
ensureTagMetadata,
|
||||
normalizeTaskIds
|
||||
};
|
||||
Reference in New Issue
Block a user