(cacheKey)
| 34 | } |
| 35 | |
| 36 | export async function chatCacheRead(cacheKey) { |
| 37 | const db = await openChatCacheDb(); |
| 38 | return new Promise((resolve, reject) => { |
| 39 | const tx = db.transaction(CHAT_CACHE_STORE, 'readonly'); |
| 40 | const req = tx.objectStore(CHAT_CACHE_STORE).get(cacheKey); |
| 41 | req.onerror = () => reject(req.error || new Error('Failed to read chat cache')); |
| 42 | req.onsuccess = () => resolve(req.result || null); |
| 43 | }); |
| 44 | } |
| 45 | |
| 46 | export async function chatCacheWrite(record) { |
| 47 | const db = await openChatCacheDb(); |
no test coverage detected