( adapter: SessionRuntimeAdapter, sessionId: string, timeRange: ContactsTimeRangeState, factsCache: ContactsFactsCacheContext | null )
| 197 | } |
| 198 | |
| 199 | function getSessionFacts( |
| 200 | adapter: SessionRuntimeAdapter, |
| 201 | sessionId: string, |
| 202 | timeRange: ContactsTimeRangeState, |
| 203 | factsCache: ContactsFactsCacheContext | null |
| 204 | ): ContactsSessionFacts { |
| 205 | const dbVersion = getSessionDbVersion(adapter, sessionId) |
| 206 | const cached = readSessionFacts(sessionId, timeRange, factsCache, dbVersion) |
| 207 | if (cached) return cached |
| 208 | |
| 209 | const facts = computeSessionFacts(adapter, sessionId, timeRange) |
| 210 | writeSessionFacts(adapter, sessionId, timeRange, factsCache, facts, dbVersion) |
| 211 | return facts |
| 212 | } |
| 213 | |
| 214 | function computeSessionFacts( |
| 215 | adapter: SessionRuntimeAdapter, |
no test coverage detected