feat: failure to decrypt history = failure to sync

Now that the user can purge their store and _do something_ about invalid
records, we should not tolerate mixed key records in store.
This commit is contained in:
Ellie Huxtable 2024-02-02 14:35:30 +00:00
parent 754f17ddb4
commit 3c420f85f6

View File

@ -164,15 +164,7 @@ impl HistoryStore {
for record in records.into_iter() {
let hist = match record.version.as_str() {
HISTORY_VERSION => {
let decrypted = record.decrypt::<PASETO_V4>(&self.encryption_key);
let decrypted = match decrypted {
Ok(d) => d,
Err(e) => {
println!("failed to decrypt history: {e}");
continue;
}
};
let decrypted = record.decrypt::<PASETO_V4>(&self.encryption_key)?;
HistoryRecord::deserialize(&decrypted.data, HISTORY_VERSION)
}