diff --git a/.changes/tauri-error-sync.md b/.changes/tauri-error-sync.md new file mode 100644 index 000000000..3fb1c3e88 --- /dev/null +++ b/.changes/tauri-error-sync.md @@ -0,0 +1,5 @@ +--- +'tauri': 'patch:bug' +--- + +Fix regression in `tauri::Error` not being `Sync`. diff --git a/.changes/tauri-scope-object-error-sync.md b/.changes/tauri-scope-object-error-sync.md new file mode 100644 index 000000000..8af76397d --- /dev/null +++ b/.changes/tauri-scope-object-error-sync.md @@ -0,0 +1,5 @@ +--- +'tauri': 'patch:breaking' +--- + +Require `ScopeObject::Error` to be `Sync` as well. diff --git a/core/tauri/src/error.rs b/core/tauri/src/error.rs index fc62f5018..933b2449a 100644 --- a/core/tauri/src/error.rs +++ b/core/tauri/src/error.rs @@ -147,8 +147,17 @@ pub enum Error { UnstableFeatureNotSupported, /// Failed to deserialize scope object. #[error("error deserializing scope: {0}")] - CannotDeserializeScope(Box), + CannotDeserializeScope(Box), } /// `Result` pub type Result = std::result::Result; + +#[cfg(test)] +mod tests { + #[test] + fn error_is_send_sync() { + crate::test_utils::assert_send::(); + crate::test_utils::assert_sync::(); + } +} diff --git a/core/tauri/src/ipc/authority.rs b/core/tauri/src/ipc/authority.rs index 67dc947c5..1ff3f4a91 100644 --- a/core/tauri/src/ipc/authority.rs +++ b/core/tauri/src/ipc/authority.rs @@ -363,7 +363,7 @@ pub struct ScopeManager { /// though this is useful if you need to do some initialization logic on the type itself. pub trait ScopeObject: Sized + Send + Sync + Debug + 'static { /// The error type. - type Error: std::error::Error + Send; + type Error: std::error::Error + Send + Sync; /// Deserialize the raw scope value. fn deserialize(app: &AppHandle, raw: Value) -> Result; }