MCPcopy Create free account
hub / github.com/claude-code-best/claude-code / publishTaskState

Function publishTaskState

src/hooks/useReplBridge.tsx:833–853  ·  view source on GitHub ↗
()

Source from the content-addressed store, hash-verified

831 };
832
833 const publishTaskState = async (): Promise<void> => {
834 const handle = handleRef.current;
835 if (!handle) return;
836
837 const taskListId = getTaskListId();
838 rewatch(getTasksDir(taskListId));
839
840 try {
841 const tasks = await listTasks(taskListId);
842 if (cancelled || handleRef.current !== handle) return;
843 const snapshotKey = getTaskStateSnapshotKey(taskListId, tasks);
844 if (snapshotKey === lastPublishedSnapshotKey && handle === lastPublishedHandle) {
845 return;
846 }
847 handle.writeSdkMessages([buildTaskStateMessage(taskListId, tasks)]);
848 lastPublishedSnapshotKey = snapshotKey;
849 lastPublishedHandle = handle;
850 } catch (err) {
851 logForDebugging(`[bridge:repl] Failed to publish task_state: ${errorMessage(err)}`, { level: 'error' });
852 }
853 };
854
855 const schedulePublish = (): void => {
856 if (debounceTimer) clearTimeout(debounceTimer);

Callers 2

schedulePublishFunction · 0.85
useReplBridgeFunction · 0.85

Calls 8

getTaskListIdFunction · 0.85
rewatchFunction · 0.85
getTasksDirFunction · 0.85
listTasksFunction · 0.85
getTaskStateSnapshotKeyFunction · 0.85
buildTaskStateMessageFunction · 0.85
logForDebuggingFunction · 0.50
errorMessageFunction · 0.50

Tested by

no test coverage detected