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

Function getDuplicateSessionIds

desktop/thread-state-db/session-writes.ts:26–40  ·  view source on GitHub ↗
(sessions: SessionSummaryRecord[])

Source from the content-addressed store, hash-verified

24}
25
26function getDuplicateSessionIds(sessions: SessionSummaryRecord[]) {
27 const sessionPathsById = new Map<string, Set<string>>()
28
29 for (const session of sessions) {
30 const sessionPaths = sessionPathsById.get(session.id) ?? new Set<string>()
31 sessionPaths.add(session.sessionPath)
32 sessionPathsById.set(session.id, sessionPaths)
33 }
34
35 return new Set(
36 [...sessionPathsById.entries()]
37 .filter(([, sessionPaths]) => sessionPaths.size > 1)
38 .map(([sessionId]) => sessionId),
39 )
40}
41
42export function syncSessionSummaries(cwd: string, sessions: SessionSummaryRecord[]) {
43 const db = getThreadStateDatabase()

Callers 1

syncSessionSummariesFunction · 0.85

Calls 1

getMethod · 0.80

Tested by

no test coverage detected