mirror of
https://github.com/eyaltoledano/claude-task-master.git
synced 2026-01-30 06:12:05 +00:00
fix: use type-coerced ID matching in FileStorage subtask metadata preservation
Use String(st.id) === String(updatedSubtask.id) instead of strict equality to handle type mismatches (AI may return string IDs vs numeric). Also add title-based fallback matching. Addresses CodeRabbit duplicate comment about FileStorage ID matching.
This commit is contained in:
committed by
Ralph Khreish
parent
2a347dae27
commit
bcee5b75dd
@@ -380,8 +380,11 @@ export class FileStorage implements IStorage {
|
||||
let mergedSubtasks = updates.subtasks;
|
||||
if (updates.subtasks && existingTask.subtasks) {
|
||||
mergedSubtasks = updates.subtasks.map((updatedSubtask) => {
|
||||
// Type-coerce IDs for comparison; fall back to title match if IDs don't match
|
||||
const originalSubtask = existingTask.subtasks?.find(
|
||||
(st) => st.id === updatedSubtask.id
|
||||
(st) =>
|
||||
String(st.id) === String(updatedSubtask.id) ||
|
||||
(updatedSubtask.title && st.title === updatedSubtask.title)
|
||||
);
|
||||
// Preserve original subtask's metadata if it exists
|
||||
if (originalSubtask?.metadata) {
|
||||
|
||||
Reference in New Issue
Block a user