( adapter: SessionRuntimeAdapter, sessionId: string, factsCache: ContactsFactsCacheContext | null, data: ContactsSessionLatestFacts, expectedDbVersion: string )
| 361 | } |
| 362 | |
| 363 | function writeLatestFacts( |
| 364 | adapter: SessionRuntimeAdapter, |
| 365 | sessionId: string, |
| 366 | factsCache: ContactsFactsCacheContext | null, |
| 367 | data: ContactsSessionLatestFacts, |
| 368 | expectedDbVersion: string |
| 369 | ): void { |
| 370 | if (!factsCache) return |
| 371 | const dbVersion = getSessionDbVersion(adapter, sessionId) |
| 372 | if (dbVersion !== expectedDbVersion) { |
| 373 | appLogger.debug('contacts', 'skipped contacts latest facts cache write because db version changed', { |
| 374 | sessionId, |
| 375 | }) |
| 376 | return |
| 377 | } |
| 378 | writeCachedContactsSessionLatest(sessionId, factsCache.dir, factsCache.latestKey, dbVersion, data) |
| 379 | factsCache.stats.writes++ |
| 380 | } |
| 381 | |
| 382 | function readSessionFacts( |
| 383 | sessionId: string, |
no test coverage detected