[w3c/IndexedDB] Old db version is lost when aborting upgrade (Issue #486)

gterzian created an issue (w3c/IndexedDB#486)

https://w3c.github.io/IndexedDB/#abort-an-upgrade-transaction

> Set connection’s [version](https://w3c.github.io/IndexedDB/#connection-version) to database’s [version](https://w3c.github.io/IndexedDB/#database-version) if database previously existed, or 0 (zero) if database was newly created.

But by then, the db version has already been set to the requested version at https://w3c.github.io/IndexedDB/#upgrade-a-database

> Let old version be db’s [version](https://w3c.github.io/IndexedDB/#database-version).
> Set db’s [version](https://w3c.github.io/IndexedDB/#database-version) to version. This change is considered part of the [transaction](https://w3c.github.io/IndexedDB/#transaction-concept), and so if the transaction is [aborted](https://w3c.github.io/IndexedDB/#transaction-abort), this change is reverted.

To properly revert the change, `oldVersion` needs to be stored somewhere that is accessible from #abort-an-upgrade-transaction, for example on the transaction. 

-- 
Reply to this email directly or view it on GitHub:
https://github.com/w3c/IndexedDB/issues/486
You are receiving this because you are subscribed to this thread.

Message ID: <w3c/IndexedDB/issues/486@github.com>

Received on Monday, 5 January 2026 07:07:38 UTC