Skip to content

armgit / ente

Public Imported from GitHub
0

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

[photos] Restore existing download comments

AswinAsokc6aa827ca0ff
diff --git a/web/packages/gallery/services/download-core.ts b/web/packages/gallery/services/download-core.ts
index a875b2c2ed..a624d3d8cb 100644
--- a/web/packages/gallery/services/download-core.ts
+++ b/web/packages/gallery/services/download-core.ts
@@ -353,6 +353,7 @@ class DownloadManagerCore {
);
}
+ // A network read can contain several encrypted chunks.
while (data.length > decryptionChunkSize) {
const decryptedData = await decryptStreamChunk(
data.slice(0, decryptionChunkSize),
@@ -366,6 +367,7 @@ class DownloadManagerCore {
}
if (done) {
+ // Only EOF proves that a short remainder is the final chunk.
if (!data.length)
throw new Error(
"Missing final encrypted chunk",