MCPcopy Create free account
hub / github.com/GCWing/BitFun / syncSessionToModernStore

Function syncSessionToModernStore

src/web-ui/src/flow_chat/services/storeSync.ts:44–58  ·  view source on GitHub ↗
(sessionId: string)

Source from the content-addressed store, hash-verified

42 * Sync session data to new Store
43 */
44export function syncSessionToModernStore(sessionId: string): void {
45 const oldState = flowChatStore.getState();
46 const session = oldState.sessions.get(sessionId);
47
48 if (!session) {
49 log.warn('Session not found', { sessionId });
50 return;
51 }
52
53 const modernStore = useModernFlowChatStore.getState();
54 if (isSessionAlreadySynced(sessionId, session, modernStore)) {
55 return;
56 }
57 modernStore.setActiveSession(session);
58}
59
60/**
61 * Start auto sync

Callers 3

FloatingMiniChatFunction · 0.90
activateMainSessionFunction · 0.90
storeSync.test.tsFile · 0.90

Calls 4

isSessionAlreadySyncedFunction · 0.85
warnMethod · 0.80
getStateMethod · 0.65
getMethod · 0.45

Tested by

no test coverage detected