https://w3c.github.io/IndexedDB/#abort-an-upgrade-transaction
Set connection’s version to database’s 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.
Set db’s version to version. This change is considered part of the transaction, and so if the transaction is aborted, 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, or passed down as a variable.
https://w3c.github.io/IndexedDB/#abort-an-upgrade-transaction
But by then, the db version has already been set to the requested version at https://w3c.github.io/IndexedDB/#upgrade-a-database
To properly revert the change,
oldVersionneeds to be stored somewhere that is accessible from#abort-an-upgrade-transaction, for example on the transaction, or passed down as a variable.