indexeddb: Allow deleting unknown DBs. (#38076)

The current behaviour is too strict according to the spec and is the
cause of many intermittent test errors.

Testing: Existing coverage is sufficient.
Fixes: #37706

---------

Signed-off-by: Josh Matthews <josh@joshmatthews.net>
This commit is contained in:
Josh Matthews 2025-07-15 21:22:18 -04:00 committed by GitHub
parent 30b6e289e0
commit 189e649222
No known key found for this signature in database
GPG key ID: B5690EEEBB952194
7 changed files with 19 additions and 26 deletions

View file

@ -297,11 +297,17 @@ impl IndexedDBManager {
}
},
SyncOperation::DeleteDatabase(sender, origin, db_name) => {
// https://w3c.github.io/IndexedDB/#delete-a-database
// Step 4. Let db be the database named name in storageKey,
// if one exists. Otherwise, return 0 (zero).
let idb_description = IndexedDBDescription {
origin,
name: db_name,
};
self.databases.remove(&idb_description);
if self.databases.remove(&idb_description).is_none() {
let _ = sender.send(Ok(()));
return;
}
// FIXME:(rasviitanen) Possible security issue?
// FIXME:(arihant2math) using remove_dir_all with arbitrary input ...