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

Function updateTask

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

Source from the content-addressed store, hash-verified

369}
370
371export async function updateTask(
372 taskListId: string,
373 taskId: string,
374 updates: Partial<Omit<Task, 'id'>>,
375): Promise<Task | null> {
376 const path = getTaskPath(taskListId, taskId)
377
378 // Check existence before locking — proper-lockfile throws if the
379 // target file doesn't exist, and we want a clean null result.
380 const taskBeforeLock = await getTask(taskListId, taskId)
381 if (!taskBeforeLock) {
382 return null
383 }
384
385 let release: (() => Promise<void>) | undefined
386 try {
387 release = await lockfile.lock(path, LOCK_OPTIONS)
388 return await updateTaskUnsafe(taskListId, taskId, updates)
389 } finally {
390 await release?.()
391 }
392}
393
394export async function deleteTask(
395 taskListId: string,

Callers 8

callFunction · 0.85
deleteTaskFunction · 0.85
blockTaskFunction · 0.85
claimTaskWithBusyCheckFunction · 0.85
unassignTeammateTasksFunction · 0.85
tryClaimNextTaskFunction · 0.85
taskUpdateHandlerFunction · 0.85
useTaskListWatcherFunction · 0.85

Calls 4

getTaskPathFunction · 0.85
getTaskFunction · 0.85
updateTaskUnsafeFunction · 0.85
releaseFunction · 0.50

Tested by

no test coverage detected