Don't rely on cache that does not exist yet
This commit is contained in:
parent
2920e5796f
commit
db47586424
2 changed files with 6 additions and 5 deletions
|
@ -203,7 +203,7 @@ class CollectionAttributes {
|
|||
if (pathDecryptionNonce != null) {
|
||||
map['pathDecryptionNonce'] = pathDecryptionNonce;
|
||||
}
|
||||
if (version != null) map['version'] = version;
|
||||
map['version'] = version ?? 0;
|
||||
return map;
|
||||
}
|
||||
|
||||
|
|
|
@ -260,9 +260,10 @@ class CollectionsService {
|
|||
Sodium.bin2base64(encryptedPath.nonce),
|
||||
CollectionType.folder,
|
||||
CollectionAttributes(
|
||||
encryptedPath: Sodium.bin2base64(encryptedPath.encryptedData),
|
||||
pathDecryptionNonce: Sodium.bin2base64(encryptedPath.nonce),
|
||||
version: 1),
|
||||
encryptedPath: Sodium.bin2base64(encryptedPath.encryptedData),
|
||||
pathDecryptionNonce: Sodium.bin2base64(encryptedPath.nonce),
|
||||
version: 1,
|
||||
),
|
||||
null,
|
||||
null,
|
||||
));
|
||||
|
@ -347,7 +348,7 @@ class CollectionsService {
|
|||
|
||||
String decryptCollectionPath(Collection collection) {
|
||||
final key = collection.attributes.version == 1
|
||||
? getCollectionKey(collection.id)
|
||||
? _getDecryptedKey(collection)
|
||||
: _config.getKey();
|
||||
return utf8.decode(CryptoUtil.decryptSync(
|
||||
Sodium.base642bin(collection.attributes.encryptedPath),
|
||||
|
|
Loading…
Add table
Reference in a new issue