Skip to content

Commit

Permalink
Potential fix for expire timer turning off
Browse files Browse the repository at this point in the history
I had the assumption that once an expire timer was set, the field would
always be populated. I think now that this assumption is wrong.
Therefore, one should only update the expire timer if the field is
really set.
  • Loading branch information
Schmiddiii committed Jan 3, 2024
1 parent d884ef6 commit ed9d90f
Showing 1 changed file with 4 additions and 2 deletions.
6 changes: 4 additions & 2 deletions presage/src/manager/registered.rs
Original file line number Diff line number Diff line change
Expand Up @@ -46,7 +46,7 @@ use tokio::sync::Mutex;

use crate::cache::CacheCell;
use crate::serde::serde_profile_key;
use crate::store::{Store, Thread};
use crate::store::{ContentsStore, Store, Thread};

Check warning on line 49 in presage/src/manager/registered.rs

View workflow job for this annotation

GitHub Actions / clippy

unused import: `ContentsStore`

Check failure on line 49 in presage/src/manager/registered.rs

View workflow job for this annotation

GitHub Actions / cargo --all-features

unused import: `ContentsStore`
use crate::{Error, Manager};

type ServiceCipher<S> = cipher::ServiceCipher<S, StdRng>;
Expand Down Expand Up @@ -1132,7 +1132,9 @@ async fn save_message<S: Store>(
store.upsert_profile_key(&sender_uuid, profile_key)?;
}

store.update_expire_timer(&thread, data_message.expire_timer.unwrap_or_default())?;
if let Some(expire_timer) = data_message.expire_timer {
store.update_expire_timer(&thread, expire_timer)?;
}

match data_message {
DataMessage {
Expand Down

0 comments on commit ed9d90f

Please sign in to comment.