MCPcopy
hub / github.com/codeaashu/claude-code / updateTaskUnsafe

Function updateTaskUnsafe

src/utils/tasks.ts:354–368  ·  view source on GitHub ↗
(
  taskListId: string,
  taskId: string,
  updates: Partial<Omit<Task, 'id'>>,
)

Source from the content-addressed store, hash-verified

352// Internal: no lock. Callers already holding a lock on taskPath must use this
353// to avoid deadlock (claimTask, deleteTask cascade, etc.).
354async function updateTaskUnsafe(
355 taskListId: string,
356 taskId: string,
357 updates: Partial<Omit<Task, 'id'>>,
358): Promise<Task | null> {
359 const existing = await getTask(taskListId, taskId)
360 if (!existing) {
361 return null
362 }
363 const updated: Task = { ...existing, ...updates, id: taskId }
364 const path = getTaskPath(taskListId, taskId)
365 await writeFile(path, jsonStringify(updated, null, 2))
366 notifyTasksUpdated()
367 return updated
368}
369
370export async function updateTask(
371 taskListId: string,

Callers 2

updateTaskFunction · 0.85
claimTaskFunction · 0.85

Calls 4

getTaskFunction · 0.85
getTaskPathFunction · 0.85
jsonStringifyFunction · 0.85
notifyTasksUpdatedFunction · 0.85

Tested by

no test coverage detected