Skip to content

armgit / ente

Public Imported from GitHub
0

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

Remove unused upload feature flag fetch

Manav Rathiadb061435ea7
diff --git a/web/apps/albums/src/public-album/upload/pipeline/index.ts b/web/apps/albums/src/public-album/upload/pipeline/index.ts
index b023844956..d267ce70e5 100644
--- a/web/apps/albums/src/public-album/upload/pipeline/index.ts
+++ b/web/apps/albums/src/public-album/upload/pipeline/index.ts
@@ -1,11 +1,8 @@
import { exportMetadataDirectoryName } from "@/public-album/upload/pipeline/export-dirs";
import { basename, dirname } from "ente-base/file-name";
-import log from "ente-base/log";
import { customAPIOrigin } from "ente-base/origins";
import type { Collection } from "ente-media/collection";
import type { EnteFile } from "ente-media/file";
-import { nullToUndefined } from "ente-utils/transform";
-import { z } from "zod";
class UploadState {
shouldDisableCFUploadProxy = false;
@@ -83,20 +80,5 @@ export const areChecksumProtectedUploadsEnabled = () =>
_state.checksumProtectedUploadsEnabled;
const computeShouldDisableCFUploadProxy = async () => {
- if (await customAPIOrigin()) return true;
-
- try {
- const res = await fetch("https://static.ente.io/feature_flags.json");
- return (
- StaticFeatureFlags.parse(await res.json()).disableCFUploadProxy ??
- false
- );
- } catch (e) {
- log.warn("Ignoring error when getting feature_flags.json", e);
- return false;
- }
+ return !!(await customAPIOrigin());
};
-
-const StaticFeatureFlags = z.object({
- disableCFUploadProxy: z.boolean().nullish().transform(nullToUndefined),
-});
diff --git a/web/packages/gallery/services/upload/index.ts b/web/packages/gallery/services/upload/index.ts
index 4719cf79c3..e446d58588 100644
--- a/web/packages/gallery/services/upload/index.ts
+++ b/web/packages/gallery/services/upload/index.ts
@@ -5,8 +5,6 @@ import type { ZipItem } from "ente-base/types/ipc";
import { exportMetadataDirectoryName } from "ente-gallery/export-dirs";
import type { Collection } from "ente-media/collection";
import type { EnteFile } from "ente-media/file";
-import { nullToUndefined } from "ente-utils/transform";
-import { z } from "zod";
import type { ExternalParsedMetadata } from "./upload-service";
/**
@@ -511,21 +509,5 @@ const computeShouldDisableCFUploadProxy = async () => {
// In such cases, disable the Cloudflare upload proxy (which won't work for
// self-hosters), and instead just directly use the upload URLs that museum
// gives us.
- if (await customAPIOrigin()) return true;
-
- // See if the global flag to disable this is set.
- try {
- const res = await fetch("https://static.ente.io/feature_flags.json");
- return (
- StaticFeatureFlags.parse(await res.json()).disableCFUploadProxy ??
- false
- );
- } catch (e) {
- log.warn("Ignoring error when getting feature_flags.json", e);
- return false;
- }
+ return !!(await customAPIOrigin());
};
-
-const StaticFeatureFlags = z.object({
- disableCFUploadProxy: z.boolean().nullish().transform(nullToUndefined),
-});