Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

UpgradeVersion should return the upgraded version for IndexedDB #25322

Open
rasviitanen opened this issue Dec 18, 2019 · 0 comments
Open

UpgradeVersion should return the upgraded version for IndexedDB #25322

rasviitanen opened this issue Dec 18, 2019 · 0 comments

Comments

@rasviitanen
Copy link
Contributor

@rasviitanen rasviitanen commented Dec 18, 2019

When handeling the SyncOperation::UpgradeVersion case in handle_sync_operation, we currently upgrade the database version by assigning db.version = version;. As of now, this never fails and it is ok to return the value immediately. However, the database upgrade should not behave like this in once we allow multiple database connections. Instead of returning the version immediately, we should get the version from the database environment.

To illustrate:
open with version v10 -> open with version v9 -> db upgrades to v10 -> db upgrades to v9
This would result in the wrong version being returned (v9) by the upgrade version function, but the true version is v10 (we cannot downgrade the version).

Task

  • Fix the upgrade logic so that the database only upgrades if the requested version is higher
  • Return the version of the database environment

Files
components\net\indexeddb\idb_thread.rs

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Projects
None yet
Linked pull requests

Successfully merging a pull request may close this issue.

None yet
2 participants
You can’t perform that action at this time.