π End-to-end encrypted cloud for everything.
Dart 2faandroidauthye2eeencryptionend-to-end-encryptionfluttergolanggoogle-photosgoogle-photos-alternativeiosopensourcephotosprivacyprivacy-toolstypescriptzero-knowledge
Use a test stream
Manav Rathia74d904989e9
diff --git a/web/apps/photos/src/services/export/index.ts b/web/apps/photos/src/services/export/index.tsindex 99e2ac1a81..40bb9345f1 100644--- a/web/apps/photos/src/services/export/index.ts+++ b/web/apps/photos/src/services/export/index.ts@@ -995,6 +995,19 @@ class ExportService {);// TODO(MR): Productionalizeif (isDevBuild) {+ const testStream = new ReadableStream({+ async start(controller) {+ await sleep(1000);+ controller.enqueue("This ");+ await sleep(1000);+ controller.enqueue("is ");+ await sleep(1000);+ controller.enqueue("a ");+ await sleep(1000);+ controller.enqueue("test");+ controller.close();+ },+ }).pipeThrough(new TextEncoderStream());console.log({ a: "will send req", updatedFileStream });// The duplex parameter needs to be set to 'half' when// streaming requests.@@ -1011,9 +1024,10 @@ class ExportService {// include the "duplex" parameter, so we need to cast to// get TypeScript to let this code through. e.g. see// https://github.com/node-fetch/node-fetch/issues/1769- const req = new Request("stream://foo", {+ const req = new Request("stream://write/tmp/foo.txt", {method: "POST",- body: updatedFileStream,+ // body: updatedFileStream,+ body: testStream,duplex: "half",} as unknown as RequestInit);const res = await fetch(req);