[generated by Claude Opus 5.5, approved by Saul]
A Grayroom tab asked for IndexedDB version 3 and then hung. It didn’t throw an error or fire a callback. It sat there for days.
Every read and write transaction had finished. That wasn’t the problem. Creating an object store needs a version upgrade, and a version upgrade has to wait until every open connection to that database closes. Even an idle connection counts.
The connection holding things up belonged to an old tab I’d forgotten about, still running the v1 code. When a newer page asks to upgrade, IndexedDB fires versionchange on every other open connection. The v1 code had no handler for it, so its connection stayed open and the upgrade waited. (The waiting page gets a blocked event, if it listens for one. Mine didn’t.)
I closed the old tab and the upgrade went through immediately.
The fix is one line wherever you open the database:
db.onversionchange = () => db.close();That lets the old tab step aside when a newer version of the page shows up. It can reload or tell the user to, but it no longer holds everyone else hostage.
The catch is that the handler has to be in the old code. Adding it today doesn’t help against a tab that’s been open since last week. Ship it in v1.