Skip to content

armgit / ente

Public Imported from GitHub
0

πŸ’š End-to-end encrypted cloud for everything.

Fix membership

Vishnu Mohandasa7d2c2d5628a
diff --git a/web/apps/locker/src/services/remote-read.ts b/web/apps/locker/src/services/remote-read.ts
index 87061d0aae..e5651ed42e 100644
--- a/web/apps/locker/src/services/remote-read.ts
+++ b/web/apps/locker/src/services/remote-read.ts
@@ -474,11 +474,14 @@ const decryptAllData = async (
const totalCollectionCount = activeCollectionRecords.length;
const filesByCollection = new Map<number, EncryptedFileRecord[]>();
+ const collectionIDsByFileID = new Map<number, number[]>();
for (const records of cache.files.values()) {
+ const sharedCollectionIDs = [...records.keys()];
for (const file of records.values()) {
const existing = filesByCollection.get(file.collectionID) ?? [];
existing.push(file);
filesByCollection.set(file.collectionID, existing);
+ collectionIDsByFileID.set(file.id, sharedCollectionIDs);
}
}
@@ -502,9 +505,14 @@ const decryptAllData = async (
),
),
);
- const items = decryptedItems.filter(
- (item): item is LockerItem => item !== undefined,
- );
+ const items = decryptedItems
+ .filter((item): item is LockerItem => item !== undefined)
+ .map((item) => ({
+ ...item,
+ collectionIDs:
+ collectionIDsByFileID.get(item.id) ??
+ item.collectionIDs,
+ }));
result.push({
id: collectionRecord.id,