Bug Description
In src/services/github.js, openDB() opens an IndexedDB database connection on every cached API request (cacheGet, cacheSet, cacheClear). However, the returned db handle is never closed once the transaction finishes or encounters an error.
When analyzing an organization with multiple repositories and fetching contributors, issues, and pull requests, hundreds of IDBDatabase connection handles remain open concurrently in the browser tab. This causes memory buildup and can trigger connection limit warnings or block database upgrades.
Steps to Reproduce
- Open OrgExplorer and analyze an organization with multiple repositories.
- Open Chrome DevTools -> Application -> Storage -> IndexedDB ->
orgexplorer_cache.
- Observe active database connection handles persisting without closing.
Code Context
In src/services/github.js:
export async function cacheGet(key) {
try {
const db = await openDB()
return new Promise(res => {
const req = db.transaction(STORE, 'readonly').objectStore(STORE).get(key)
req.onsuccess = () => {
const r = req.result
if (!r || Date.now() - r.ts > TTL_MS) return res(null)
res(r.v)
// Missing db.close() cleanup
}
req.onerror = () => res(null)
})
} catch { return null }
}
By contrast, src/services/cache.js properly handles transaction lifecycles and calls db.close() on completion and error.
Environment Details
- Location:
src/services/github.js
- Impacted Browsers: All browsers supporting IndexedDB (Chrome, Firefox, Safari, Edge)
Impact
High - Major feature is broken
Bug Description
In
src/services/github.js,openDB()opens an IndexedDB database connection on every cached API request (cacheGet,cacheSet,cacheClear). However, the returneddbhandle is never closed once the transaction finishes or encounters an error.When analyzing an organization with multiple repositories and fetching contributors, issues, and pull requests, hundreds of
IDBDatabaseconnection handles remain open concurrently in the browser tab. This causes memory buildup and can trigger connection limit warnings or block database upgrades.Steps to Reproduce
orgexplorer_cache.Code Context
In
src/services/github.js:By contrast,
src/services/cache.jsproperly handles transaction lifecycles and callsdb.close()on completion and error.Environment Details
src/services/github.jsImpact
High - Major feature is broken