Skip to content

armgit / ente

Public Imported from GitHub
0

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

Prepare for internal users

Manav Rathibae717dc69ab
diff --git a/web/packages/new/photos/services/feature-flags.ts b/web/packages/new/photos/services/feature-flags.ts
index fb48086d46..1f2e4329bc 100644
--- a/web/packages/new/photos/services/feature-flags.ts
+++ b/web/packages/new/photos/services/feature-flags.ts
@@ -1,4 +1,3 @@
-import { isDevBuild } from "@/base/env";
import { authenticatedRequestHeaders, ensureOk } from "@/base/http";
import { localUser } from "@/base/local-user";
import log from "@/base/log";
@@ -104,16 +103,13 @@ const remoteFeatureFlagsFetchingIfNeeded = async () => {
/**
* Return `true` if the current user is marked as an "internal" user.
*
- * 1. Everyone is considered as an internal user in dev builds.
- * 2. Emails that end in `@ente.io` are always considered as internal users.
- * 3. If the "internalUser" remote feature flag is set, the user is internal.
- * 4. Otherwise false.
+ * 1. Emails that end in `@ente.io` are considered as internal users.
+ * 2. If the "internalUser" remote feature flag is set, the user is internal.
+ * 3. Otherwise false.
*
* See also: [Note: Feature Flags].
*/
export const isInternalUser = async () => {
- if (isDevBuild) return true;
-
const user = localUser();
if (user?.email.endsWith("@ente.io")) return true;
diff --git a/web/packages/new/photos/services/ml/index.ts b/web/packages/new/photos/services/ml/index.ts
index 91144b4f91..c3432b1023 100644
--- a/web/packages/new/photos/services/ml/index.ts
+++ b/web/packages/new/photos/services/ml/index.ts
@@ -11,7 +11,7 @@ import { FileType } from "@/media/file-type";
import type { EnteFile } from "@/new/photos/types/file";
import { throttled } from "@/utils/promise";
import { proxy } from "comlink";
-import { isBetaUser, isInternalUser } from "../feature-flags";
+import { isInternalUser } from "../feature-flags";
import { getRemoteFlag, updateRemoteFlag } from "../remote-store";
import type { UploadItem } from "../upload/types";
import { regenerateFaceCrops } from "./crop";
@@ -97,17 +97,17 @@ export const terminateMLWorker = () => {
*
* ML currently only works when we're running in our desktop app.
*/
-// TODO-ML:
-export const isMLSupported =
- isDesktop && process.env.NEXT_PUBLIC_ENTE_ENABLE_WIP_ML_DONT_USE;
+export const isMLSupported = isDesktop;
/**
+ * TODO-ML: This will not be needed when we move to a public beta.
* Was this someone who might've enabled the beta ML? If so, show them the
* coming back soon banner while we finalize it.
- * TODO-ML:
*/
export const canEnableML = async () =>
- (await isInternalUser()) || (await isBetaUser());
+ // TODO-ML: The interim condition should be
+ // isDevBuild || (await isInternalUser()) || (await isBetaUser());
+ await isInternalUser();
/**
* Initialize the ML subsystem if the user has enabled it in preferences.
diff --git a/web/packages/new/photos/services/ml/people.ts b/web/packages/new/photos/services/ml/people.ts
index 97118ea94a..90e1314571 100644
--- a/web/packages/new/photos/services/ml/people.ts
+++ b/web/packages/new/photos/services/ml/people.ts
@@ -5,8 +5,7 @@ export interface Person {
displayFaceId: string;
}
-// TODO-ML(MR): Forced disable clustering. It doesn't currently work,
-// need to finalize it before we move out of beta.
+// Forced disable clustering. It doesn't currently work.
//
// > Error: Failed to execute 'transferToImageBitmap' on
// > 'OffscreenCanvas': ImageBitmap construction failed