MCPcopy Index your code
hub / github.com/ChatLab/ChatLab / resolveOverview

Function resolveOverview

apps/desktop/main/worker/query/sessions.ts:57–66  ·  view source on GitHub ↗

* Resolve overview with fingerprint-validated cache, falling back to live SQL. * * Uses getValidatedOverviewCache which checks MAX(message.id) so the cache is * automatically recomputed whenever new messages are inserted (e.g. after * incremental import), without relying on the import hook alway

(db: Database.Database, sessionId: string, cacheDir: string | null)

Source from the content-addressed store, hash-verified

55 * incremental import), without relying on the import hook always succeeding.
56 */
57function resolveOverview(db: Database.Database, sessionId: string, cacheDir: string | null): SessionOverview {
58 if (cacheDir) {
59 try {
60 return getValidatedOverviewCache(new BetterSqliteAdapter(db), sessionId, cacheDir)
61 } catch {
62 // cache compute failure — fall through to live query
63 }
64 }
65 return getSessionOverview(asCoreDb(db))
66}
67
68/**
69 * 获取所有会话列表

Callers 3

getAllSessionsFunction · 0.85
getSessionFunction · 0.85
getChatOverviewFunction · 0.85

Calls 3

getSessionOverviewFunction · 0.90
asCoreDbFunction · 0.85

Tested by

no test coverage detected