(record)
| 44 | } |
| 45 | |
| 46 | export async function chatCacheWrite(record) { |
| 47 | const db = await openChatCacheDb(); |
| 48 | return new Promise((resolve, reject) => { |
| 49 | const tx = db.transaction(CHAT_CACHE_STORE, 'readwrite'); |
| 50 | tx.oncomplete = () => resolve(); |
| 51 | tx.onerror = () => reject(tx.error || new Error('Failed to write chat cache')); |
| 52 | tx.objectStore(CHAT_CACHE_STORE).put(record); |
| 53 | }); |
| 54 | } |
| 55 | |
| 56 | export async function chatCacheDelete(cacheKey) { |
| 57 | const db = await openChatCacheDb(); |
no test coverage detected