diff options
author | Quentin Dufour <quentin@deuxfleurs.fr> | 2023-11-17 15:02:43 +0100 |
---|---|---|
committer | Quentin Dufour <quentin@deuxfleurs.fr> | 2023-11-17 15:02:43 +0100 |
commit | e92dc35564e91ce4e6a8defa9e8b52eef9e55fae (patch) | |
tree | bf33563e7858c5b8b6865c89558b2e0d305b3dec /src/mail | |
parent | 4a33ac2265dae0e8fd1f7fbaec54ab7120334cbe (diff) | |
download | aerogramme-e92dc35564e91ce4e6a8defa9e8b52eef9e55fae.tar.gz aerogramme-e92dc35564e91ce4e6a8defa9e8b52eef9e55fae.zip |
fix orphan storage compatibility
Diffstat (limited to 'src/mail')
-rw-r--r-- | src/mail/incoming.rs | 6 | ||||
-rw-r--r-- | src/mail/user.rs | 2 |
2 files changed, 4 insertions, 4 deletions
diff --git a/src/mail/incoming.rs b/src/mail/incoming.rs index db22f3e..da4c819 100644 --- a/src/mail/incoming.rs +++ b/src/mail/incoming.rs @@ -77,7 +77,7 @@ async fn incoming_mail_watch_process_internal( tokio::select! { inc_k = wait_new_mail => Some(inc_k), - _ = tokio::time::sleep(MAIL_CHECK_INTERVAL) => Some(k2v.from_orphan(incoming_key.to_orphan())), + _ = tokio::time::sleep(MAIL_CHECK_INTERVAL) => Some(k2v.from_orphan(incoming_key.to_orphan()).expect("Incompatible source & target storage")), _ = lock_held.changed() => None, _ = rx_inbox_id.changed() => None, } @@ -358,7 +358,7 @@ async fn k2v_lock_loop_internal( )); lock[8..].copy_from_slice(&our_pid.0); let row = match ct { - Some(orphan) => k2v.from_orphan(orphan), + Some(orphan) => k2v.from_orphan(orphan).expect("Source & target must be storage compatible"), None => k2v.row(pk, sk), }; if let Err(e) = row.set_value(lock).push().await { @@ -387,7 +387,7 @@ async fn k2v_lock_loop_internal( _ => None, }; if let Some(ct) = release { - let row = k2v.from_orphan(ct); + let row = k2v.from_orphan(ct).expect("Incompatible source & target storage"); let _ = row.rm().await; } } diff --git a/src/mail/user.rs b/src/mail/user.rs index 7011dcc..7a3e5c7 100644 --- a/src/mail/user.rs +++ b/src/mail/user.rs @@ -306,7 +306,7 @@ impl User { ) -> Result<()> { let list_blob = seal_serialize(list, &self.creds.keys.master)?; let rref = match ct { - Some(x) => self.k2v.from_orphan(x), + Some(x) => self.k2v.from_orphan(x).expect("Source & target must be same storage"), None => self.k2v.row(MAILBOX_LIST_PK, MAILBOX_LIST_SK), }; rref.set_value(list_blob).push().await?; |