π End-to-end encrypted cloud for everything.
Dart 2faandroidauthye2eeencryptionend-to-end-encryptionfluttergolanggoogle-photosgoogle-photos-alternativeiosopensourcephotosprivacyprivacy-toolstypescriptzero-knowledge
fix(video):remove-unsyncedUploadFiles-post-sync
Aswin Asokecca0932fbef
diff --git a/web/apps/photos/tests/video-streaming-percentage.test.ts b/web/apps/photos/tests/video-streaming-percentage.test.tsindex 253a71628f..58dfd3567f 100644--- a/web/apps/photos/tests/video-streaming-percentage.test.ts+++ b/web/apps/photos/tests/video-streaming-percentage.test.ts@@ -124,6 +124,7 @@ const {resetVideoState,streamCandidateFiles,toggleHLSGeneration,+ videoPrunePermanentlyDeletedFileIDsIfNeeded,videoProcessingSyncIfNeeded,} = await import("ente-gallery/services/video");@@ -277,6 +278,37 @@ describe("video streaming percentage", () => {);});+ test("retires unsynced uploads after they enter the saved index", async () => {+ await toggleHLSGeneration();+ processVideoNewUpload(file(1), {} as never);+ await vi.waitFor(() =>+ expect(hlsGenerationStatusSnapshot()).toMatchObject({+ enabled: true,+ processedFraction: 0,+ }),+ );++ mocks.collectionFiles = [file(1), file(2), file(3)];+ mocks.kv.set("videoPreviewProcessedFileIDs", [1, 2]);+ await initVideoProcessing();+ await vi.waitFor(() =>+ expect(hlsGenerationStatusSnapshot()).toMatchObject({+ enabled: true,+ processedFraction: 2 / 3,+ }),+ );++ mocks.collectionFiles = [file(2), file(3)];+ await videoPrunePermanentlyDeletedFileIDsIfNeeded(new Set([1]));+ await initVideoProcessing();+ await vi.waitFor(() =>+ expect(hlsGenerationStatusSnapshot()).toMatchObject({+ enabled: true,+ processedFraction: 1 / 2,+ }),+ );+ });+test("excludes files locally marked as not requiring a stream", async () => {mocks.collectionFiles = [file(1), file(2), file(3)];mocks.kv.set("videoPreviewProcessedFileIDs", [2]);diff --git a/web/packages/gallery/services/video.ts b/web/packages/gallery/services/video.tsindex 8095810342..bff9fc778a 100644--- a/web/packages/gallery/services/video.ts+++ b/web/packages/gallery/services/video.ts@@ -505,11 +505,9 @@ const savedStreamCandidateFiles = async (savedTrashItemFileIDs(),]);const savedFileIDs = new Set(savedFiles.map((file) => file.id));- const unsyncedFiles = Array.from(unsyncedUploadFiles.values()).filter(- (file) => !savedFileIDs.has(file.id),- );+ savedFileIDs.forEach((fileID) => unsyncedUploadFiles.delete(fileID));return streamCandidateFiles(- [...savedFiles, ...unsyncedFiles],+ [...savedFiles, ...unsyncedUploadFiles.values()],trashFileIDs,userID,).filter((file) => !locallySkippedFileIDs.has(file.id));