diff --git a/web/packages/new/photos/services/ml/cluster-new.ts b/web/packages/new/photos/services/ml/cluster-new.ts index 93d87e3fed..a483d6f0ec 100644 --- a/web/packages/new/photos/services/ml/cluster-new.ts +++ b/web/packages/new/photos/services/ml/cluster-new.ts @@ -65,6 +65,13 @@ export interface Person { * hidden. */ name: string | undefined; + /** + * An unordered set of ids of the clusters that belong to this person. + * + * For ergonomics of transportation and persistence this is an array, but it + * should conceptually be thought of as a set. + */ + clusterIDs: string[]; /** * True if this person should be hidden. * @@ -75,13 +82,6 @@ export interface Person { * showing this cluster). */ isHidden: boolean; - /** - * An unordered set of ids of the clusters that belong to this person. - * - * For ergonomics of transportation and persistence this is an array, but it - * should conceptually be thought of as a set. - */ - clusterIDs: string[]; /** * The ID of the face that should be used as the cover photo for this person * (if the user has set one). diff --git a/web/packages/new/photos/services/user-entity.ts b/web/packages/new/photos/services/user-entity.ts index f4e171559d..e469c72663 100644 --- a/web/packages/new/photos/services/user-entity.ts +++ b/web/packages/new/photos/services/user-entity.ts @@ -16,8 +16,8 @@ import { applyPersonDiff } from "./ml/db"; export type EntityType = | "person" /** - * A new version of the Person entity where the data is gzipped before - * encryption. + * The latest iteration of the Person entity format, where the data is + * gzipped before encryption. */ | "person_v2"; @@ -171,7 +171,9 @@ export const syncPersons = async (entityKeyB64: string) => { id, name: rp.name, clusterIDs: rp.assigned.map(({ id }) => id), - avatarFaceID: undefined, + isHidden: rp.isHidden, + avatarFaceID: rp.avatarFaceID, + displayFaceID: undefined, }; }; @@ -191,9 +193,7 @@ export const syncPersons = async (entityKeyB64: string) => { } }; -/** - * Zod schema for the "person" entity (the {@link RemotePerson} type). - */ +/** Zod schema for the {@link RemotePerson} type. */ const RemotePerson = z.object({ name: z.string().nullish().transform(nullToUndefined), assigned: z.array( @@ -208,7 +208,7 @@ const RemotePerson = z.object({ }); /** - * A "person" entity as synced via remote. + * A "person_v2" entity as synced via remote. */ type RemotePerson = z.infer;