mirror of
https://github.com/matrix-org/matrix-rust-sdk.git
synced 2026-05-18 13:40:55 -04:00
refactor(indexeddb): change indexeddb_serializer::Result to use IndexeddbSerializerError
Signed-off-by: Michael Goldenberg <m@mgoldenberg.net>
This commit is contained in:
committed by
Ivan Enderlin
parent
af90b7ac4e
commit
77ee7f1d19
@@ -19,8 +19,7 @@ use tracing::info;
|
||||
use wasm_bindgen::JsValue;
|
||||
|
||||
use crate::{
|
||||
crypto_store::{indexeddb_serializer::IndexeddbSerializer, Result},
|
||||
IndexeddbCryptoStoreError,
|
||||
crypto_store::Result, indexeddb_serializer::IndexeddbSerializer, IndexeddbCryptoStoreError,
|
||||
};
|
||||
|
||||
mod old_keys;
|
||||
|
||||
@@ -20,10 +20,10 @@ use wasm_bindgen::JsValue;
|
||||
use web_sys::{DomException, IdbTransactionMode};
|
||||
|
||||
use crate::crypto_store::{
|
||||
indexeddb_serializer::IndexeddbSerializer,
|
||||
keys,
|
||||
migrations::{do_schema_upgrade, old_keys, MigrationDb},
|
||||
};
|
||||
use crate::indexeddb_serializer::IndexeddbSerializer;
|
||||
|
||||
/// Migrate data from `backup_keys.backup_key_v1` to
|
||||
/// `backup_keys.backup_version_v1`.
|
||||
|
||||
@@ -26,11 +26,11 @@ use web_sys::{DomException, IdbTransactionMode};
|
||||
|
||||
use crate::{
|
||||
crypto_store::{
|
||||
indexeddb_serializer::IndexeddbSerializer,
|
||||
keys,
|
||||
migrations::{add_nonunique_index, do_schema_upgrade, old_keys, v7, MigrationDb},
|
||||
Result,
|
||||
},
|
||||
indexeddb_serializer::IndexeddbSerializer,
|
||||
IndexeddbCryptoStoreError,
|
||||
};
|
||||
|
||||
|
||||
@@ -22,10 +22,10 @@ use web_sys::{DomException, IdbTransactionMode};
|
||||
|
||||
use crate::{
|
||||
crypto_store::{
|
||||
indexeddb_serializer::IndexeddbSerializer,
|
||||
migrations::{do_schema_upgrade, old_keys, v7, MigrationDb},
|
||||
Result,
|
||||
},
|
||||
indexeddb_serializer::IndexeddbSerializer,
|
||||
IndexeddbCryptoStoreError,
|
||||
};
|
||||
|
||||
|
||||
@@ -22,7 +22,6 @@ use web_sys::{DomException, IdbTransactionMode};
|
||||
|
||||
use crate::{
|
||||
crypto_store::{
|
||||
indexeddb_serializer::IndexeddbSerializer,
|
||||
keys,
|
||||
migrations::{
|
||||
add_nonunique_index, do_schema_upgrade, old_keys,
|
||||
@@ -30,6 +29,7 @@ use crate::{
|
||||
},
|
||||
InboundGroupSessionIndexedDbObject, Result,
|
||||
},
|
||||
indexeddb_serializer::IndexeddbSerializer,
|
||||
IndexeddbCryptoStoreError,
|
||||
};
|
||||
|
||||
|
||||
@@ -21,7 +21,6 @@ use async_trait::async_trait;
|
||||
use gloo_utils::format::JsValueSerdeExt;
|
||||
use hkdf::Hkdf;
|
||||
use indexed_db_futures::prelude::*;
|
||||
use indexeddb_serializer::IndexeddbSerializerError;
|
||||
use js_sys::Array;
|
||||
use matrix_sdk_crypto::{
|
||||
olm::{
|
||||
@@ -48,12 +47,9 @@ use tracing::{debug, warn};
|
||||
use wasm_bindgen::JsValue;
|
||||
use web_sys::IdbKeyRange;
|
||||
|
||||
use self::indexeddb_serializer::MaybeEncrypted;
|
||||
use crate::crypto_store::{
|
||||
indexeddb_serializer::IndexeddbSerializer, migrations::open_and_upgrade_db,
|
||||
};
|
||||
use crate::crypto_store::migrations::open_and_upgrade_db;
|
||||
use crate::indexeddb_serializer::{IndexeddbSerializer, IndexeddbSerializerError, MaybeEncrypted};
|
||||
|
||||
mod indexeddb_serializer;
|
||||
mod migrations;
|
||||
|
||||
mod keys {
|
||||
|
||||
@@ -27,9 +27,9 @@ use wasm_bindgen::JsValue;
|
||||
use web_sys::IdbKeyRange;
|
||||
use zeroize::Zeroizing;
|
||||
|
||||
use crate::{safe_encode::SafeEncode, IndexeddbCryptoStoreError};
|
||||
use crate::safe_encode::SafeEncode;
|
||||
|
||||
type Result<A, E = IndexeddbCryptoStoreError> = std::result::Result<A, E>;
|
||||
type Result<A, E = IndexeddbSerializerError> = std::result::Result<A, E>;
|
||||
|
||||
const BASE64: GeneralPurpose = GeneralPurpose::new(&alphabet::STANDARD, general_purpose::NO_PAD);
|
||||
|
||||
@@ -6,6 +6,8 @@ use thiserror::Error;
|
||||
|
||||
#[cfg(feature = "e2e-encryption")]
|
||||
mod crypto_store;
|
||||
#[cfg(feature = "e2e-encryption")]
|
||||
mod indexeddb_serializer;
|
||||
mod safe_encode;
|
||||
#[cfg(feature = "e2e-encryption")]
|
||||
mod serialize_bool_for_indexeddb;
|
||||
|
||||
Reference in New Issue
Block a user