Skip to content

Old db version is lost when aborting upgrade #486

@gterzian

Description

@gterzian

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.

Metadata

Metadata

Assignees

No one assigned

    Labels

    No labels
    No labels

    Type

    No type

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions