MCPcopy Create free account
hub / github.com/IgorWarzocha/howcode / deleteManyThreadsFromPayload

Function deleteManyThreadsFromPayload

desktop/pi-threads/thread-actions.ts:75–90  ·  view source on GitHub ↗
(payload: AnyDesktopActionPayload)

Source from the content-addressed store, hash-verified

73) => Promise<ActionHandlerResult> | ActionHandlerResult
74
75async function deleteManyThreadsFromPayload(payload: AnyDesktopActionPayload) {
76 const threadIds = getThreadIds(payload)
77 if (threadIds.length === 0) return handledAction()
78
79 const deleteResult = await deletePersistedThreads(threadIds)
80 if (deleteResult.failedThreadIds.length > 0) {
81 return handledAction({
82 deletedThreadIds: deleteResult.deletedThreadIds,
83 didMutate: deleteResult.deletedThreadIds.length > 0,
84 error: `Failed to delete ${deleteResult.failedThreadIds.length} thread(s).`,
85 failedThreadIds: deleteResult.failedThreadIds,
86 })
87 }
88
89 return handledAction({ deletedThreadIds: deleteResult.deletedThreadIds })
90}
91
92const threadActionHandlers = {
93 'thread.pin': (payload) => {

Callers

nothing calls this directly

Calls 3

getThreadIdsFunction · 0.90
handledActionFunction · 0.90
deletePersistedThreadsFunction · 0.85

Tested by

no test coverage detected