Fix shared collection deserialization
Co-Authored-By: Claude <noreply@anthropic.com>
This commit is contained in:
@@ -98,7 +98,7 @@ The project has completed foundational components (crypto, storage, models) and
|
||||
|
||||
## Commit Guidelines
|
||||
|
||||
### Pre-commit Checklist
|
||||
### Pre-commit Checklist (RUN BEFORE EVERY COMMIT!)
|
||||
|
||||
**CRITICAL: CI will fail if ANY of these checks fail. Run ALL commands and ensure they ALL pass.**
|
||||
|
||||
|
||||
@@ -170,7 +170,7 @@ pub struct Collection {
|
||||
pub id: i64,
|
||||
pub owner: CollectionUser,
|
||||
pub encrypted_key: String,
|
||||
pub key_decryption_nonce: String,
|
||||
pub key_decryption_nonce: Option<String>,
|
||||
pub name: Option<String>,
|
||||
pub encrypted_name: Option<String>,
|
||||
pub name_decryption_nonce: Option<String>,
|
||||
|
||||
@@ -181,9 +181,18 @@ async fn export_account(storage: &Storage, account: &Account, filter: &ExportFil
|
||||
);
|
||||
|
||||
// Decrypt collection key
|
||||
// Shared collections don't have key_decryption_nonce - they use a different mechanism
|
||||
let Some(ref key_nonce) = collection.key_decryption_nonce else {
|
||||
log::warn!(
|
||||
"Collection {} appears to be shared (no key_decryption_nonce), skipping for now",
|
||||
collection.id
|
||||
);
|
||||
continue;
|
||||
};
|
||||
|
||||
let collection_key = match decrypt_collection_key(
|
||||
&collection.encrypted_key,
|
||||
&collection.key_decryption_nonce,
|
||||
key_nonce,
|
||||
master_key,
|
||||
secret_key,
|
||||
) {
|
||||
|
||||
Reference in New Issue
Block a user