* 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)
| 55 | * incremental import), without relying on the import hook always succeeding. |
| 56 | */ |
| 57 | function 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 | * 获取所有会话列表 |
no test coverage detected