IndexedDB: communicate transaction errors and async response data more precisely (#38027)

Digging into several crashing tests revealed that committing
transactions is a fallible operation. Propagating those errors led to
exposing many new errors caused by the IDBRequest implementation
assuming that all successful responses contained a structured clone. The
end result is a bunch of new test failures that were previously hidden.

Testing: Existing test coverage is sufficient.

---------

Signed-off-by: Josh Matthews <josh@joshmatthews.net>
This commit is contained in:
Josh Matthews 2025-07-14 22:04:28 -04:00 committed by GitHub
parent 027954dbad
commit 312985faff
No known key found for this signature in database
GPG key ID: B5690EEEBB952194
9 changed files with 196 additions and 51 deletions

View file

@ -5,7 +5,7 @@
use std::collections::VecDeque;
use ipc_channel::ipc::IpcSender;
use net_traits::indexeddb_thread::{AsyncOperation, IndexedDBTxnMode};
use net_traits::indexeddb_thread::{AsyncOperation, IdbResult, IndexedDBTxnMode};
use tokio::sync::oneshot;
pub use self::heed::HeedEngine;
@ -46,7 +46,7 @@ impl std::fmt::Display for SanitizedName {
}
pub struct KvsOperation {
pub sender: IpcSender<Option<Vec<u8>>>,
pub sender: IpcSender<Result<Option<IdbResult>, ()>>,
pub store_name: SanitizedName,
pub operation: AsyncOperation,
}