mirror of
https://github.com/servo/servo.git
synced 2025-08-05 13:40:08 +01:00
[IndexedDB] Fix upgrade version operation (#37653)
Rejects version upgrade if the upgraded version is lower than the current database version. Also returns the actual version instead of the requested upgrade version. Testing: WPT tests might cover this Fixes: #25322 Signed-off-by: Ashwin Naren <arihant2math@gmail.com>
This commit is contained in:
parent
94a7428912
commit
2265570c88
1 changed files with 8 additions and 7 deletions
|
@ -319,13 +319,14 @@ impl IndexedDBManager {
|
||||||
},
|
},
|
||||||
SyncOperation::UpgradeVersion(sender, origin, db_name, _txn, version) => {
|
SyncOperation::UpgradeVersion(sender, origin, db_name, _txn, version) => {
|
||||||
if let Some(db) = self.get_database_mut(origin, db_name) {
|
if let Some(db) = self.get_database_mut(origin, db_name) {
|
||||||
db.version = version;
|
if version > db.version {
|
||||||
};
|
db.version = version;
|
||||||
|
}
|
||||||
// FIXME:(arihant2math) Get the version from the database instead
|
// erroring out if the version is not upgraded can be and non-replicable
|
||||||
// We never fail as of now, so we can just return it like this
|
let _ = sender.send(Ok(db.version));
|
||||||
// for now...
|
} else {
|
||||||
sender.send(Ok(version)).expect("Could not upgrade version");
|
let _ = sender.send(Err(()));
|
||||||
|
}
|
||||||
},
|
},
|
||||||
SyncOperation::CreateObjectStore(
|
SyncOperation::CreateObjectStore(
|
||||||
sender,
|
sender,
|
||||||
|
|
Loading…
Add table
Add a link
Reference in a new issue