MCPcopy Index your code
hub / github.com/Noumena-Network/code / updateTaskUnsafe

Function updateTaskUnsafe

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

Source from the content-addressed store, hash-verified

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