net: fix indexeddb backend bugs (#38744)

Fix a large number of backend issues that were masking everything else.
There probably is still more, but it'll take more integration/unit
testing to find it.

Testing: WPT
Fixes: #38743

---------

Signed-off-by: Ashwin Naren <arihant2math@gmail.com>
This commit is contained in:
Ashwin Naren 2025-08-19 13:44:49 -07:00 committed by GitHub
parent f2294db95b
commit d0a8f27241
No known key found for this signature in database
GPG key ID: B5690EEEBB952194
15 changed files with 113 additions and 146 deletions

View file

@ -12,8 +12,8 @@ use js::jsval::{DoubleValue, JSVal, UndefinedValue};
use js::rust::HandleValue;
use net_traits::IpcSend;
use net_traits::indexeddb_thread::{
AsyncOperation, BackendResult, IndexedDBKeyType, IndexedDBThreadMsg, IndexedDBTxnMode,
PutItemResult,
AsyncOperation, BackendError, BackendResult, IndexedDBKeyType, IndexedDBThreadMsg,
IndexedDBTxnMode, PutItemResult,
};
use profile_traits::ipc::IpcReceiver;
use serde::{Deserialize, Serialize};
@ -296,7 +296,11 @@ impl IDBRequest {
let response_listener = response_listener.clone();
task_source.queue(task!(request_callback: move || {
response_listener.handle_async_request_finished(
message.expect("Could not unwrap message").map(|t| t.into()));
message.expect("Could not unwrap message").inspect_err(|e| {
if let BackendError::DbErr(e) = e {
error!("Error in IndexedDB operation: {}", e);
}
}).map(|t| t.into()));
}));
}),
);