💚 End-to-end encrypted cloud for everything.
Dart 2faandroidauthye2eeencryptionend-to-end-encryptionfluttergolanggoogle-photosgoogle-photos-alternativeiosopensourcephotosprivacyprivacy-toolstypescriptzero-knowledge
Update comments to match prettier defaults
Manav Rathi9aae71320710
diff --git a/web/apps/photos/src/components/FixCreationTime.tsx b/web/apps/photos/src/components/FixCreationTime.tsxindex c30bd4b258..dc1140f561 100644--- a/web/apps/photos/src/components/FixCreationTime.tsx+++ b/web/apps/photos/src/components/FixCreationTime.tsx@@ -296,11 +296,11 @@ const updateFiles = async (* This is generally treated as the creation date of the underlying asset* (photo, video, live photo) that this file stores.*- * - For images, this function allows us to update this date from the Exif and- * other metadata embedded in the file.+ * - For images, this function allows us to update this date from the Exif and+ * other metadata embedded in the file.*- * - For all types of files (including images), this function allows us to- * update this date to an explicitly provided value.+ * - For all types of files (including images), this function allows us to+ * update this date to an explicitly provided value.** If an Exif-involving {@link fixOption} is passed for an non-image file, then* that file is just skipped over. Similarly, if an Exif-involvingdiff --git a/web/apps/photos/src/services/export/index.ts b/web/apps/photos/src/services/export/index.tsindex 48f76c8566..ee9c15941b 100644--- a/web/apps/photos/src/services/export/index.ts+++ b/web/apps/photos/src/services/export/index.ts@@ -1270,11 +1270,11 @@ const readOnDiskFileExportRecordIDs = async (// Both the paths involved are guaranteed to use POSIX separators and thus// can directly be compared.//- // - `exportDir` traces its origin to `electron.selectDirectory()`, which- // returns POSIX paths. Down below we use it as the base directory when- // constructing paths for the items to export.+ // - `exportDir` traces its origin to `electron.selectDirectory()`, which+ // returns POSIX paths. Down below we use it as the base directory when+ // constructing paths for the items to export.//- // - `findFiles` is also guaranteed to return POSIX paths.+ // - `findFiles` is also guaranteed to return POSIX paths.//const ls = new Set(await ensureElectron().fs.findFiles(exportDir));diff --git a/web/packages/accounts/services/passkey.ts b/web/packages/accounts/services/passkey.tsindex 9f5687aa50..a0c12098eb 100644--- a/web/packages/accounts/services/passkey.ts+++ b/web/packages/accounts/services/passkey.ts@@ -73,13 +73,13 @@ interface OpenPasskeyVerificationURLOptions {* way it works in the mobile app - the system browser is invoked to open* accounts.ente.io.*- * - For passkey creation, this is a one-way open. Passkeys get created at- * accounts.ente.io, and that's it.+ * - For passkey creation, this is a one-way open. Passkeys get created at+ * accounts.ente.io, and that's it.*- * - For passkey verification, the flow is two-way. We register a custom- * protocol and provide that as a return path redirect. Passkey- * authentication happens at accounts.ente.io, and on success there is- * redirected back to the desktop app.+ * - For passkey verification, the flow is two-way. We register a custom+ * protocol and provide that as a return path redirect. Passkey authentication+ * happens at accounts.ente.io, and on success there is redirected back to the+ * desktop app.*/export const openPasskeyVerificationURL = ({passkeySessionID,diff --git a/web/packages/base/crypto/libsodium.ts b/web/packages/base/crypto/libsodium.tsindex 5c73f09530..dcbd2f4803 100644--- a/web/packages/base/crypto/libsodium.ts+++ b/web/packages/base/crypto/libsodium.ts@@ -57,14 +57,13 @@ export const toB64URLSafe = async (input: Uint8Array) => {* trailing padding character(s) "=" to make the resultant string's length be an* integer multiple of 4.*- * - In some contexts, for example when serializing WebAuthn binary for- * transmission over the network, this is the required / recommended- * approach.+ * - In some contexts, for example when serializing WebAuthn binary for+ * transmission over the network, this is the required / recommended approach.*- * - In other cases, for example when trying to pass an arbitrary JSON string- * via a URL parameter, this is also convenient so that we do not have to- * deal with any ambiguity surrounding the "=" which is also the query- * parameter key value separator.+ * - In other cases, for example when trying to pass an arbitrary JSON string+ * via a URL parameter, this is also convenient so that we do not have to deal+ * with any ambiguity surrounding the "=" which is also the query parameter+ * key value separator.*/export const toB64URLSafeNoPadding = async (input: Uint8Array) => {await sodium.ready;@@ -279,9 +278,9 @@ export const encryptBoxB64 = async (** @returns The encrypted data and the decryption header as {@link Uint8Array}s.*- * - See: [Note: 3 forms of encryption (Box | Blob | Stream)].+ * - See: [Note: 3 forms of encryption (Box | Blob | Stream)].*- * - See: https://doc.libsodium.org/secret-key_cryptography/secretstream+ * - See: https://doc.libsodium.org/secret-key_cryptography/secretstream*/export const encryptBlob = async (data: BytesOrB64,@@ -348,9 +347,9 @@ export const streamEncryptionChunkSize = 4 * 1024 * 1024;* @returns The encrypted bytes ({@link Uint8Array}) and the decryption header* (as a base64 string).*- * - See: [Note: 3 forms of encryption (Box | Blob | Stream)].+ * - See: [Note: 3 forms of encryption (Box | Blob | Stream)].*- * - See: https://doc.libsodium.org/secret-key_cryptography/secretstream+ * - See: https://doc.libsodium.org/secret-key_cryptography/secretstream*/export const encryptStreamBytes = async (data: Uint8Array,diff --git a/web/packages/base/http.ts b/web/packages/base/http.tsindex 0b9850ce4e..91f9b412dd 100644--- a/web/packages/base/http.ts+++ b/web/packages/base/http.ts@@ -8,8 +8,8 @@ import log from "./log";* Return headers that should be passed alongwith (almost) all authenticated* `fetch` calls that we make to our API servers.*- * - The auth token- * - The client package name.+ * - The auth token+ * - The client package name.*/export const authenticatedRequestHeaders = async () => ({"X-Auth-Token": await ensureAuthToken(),@@ -20,7 +20,7 @@ export const authenticatedRequestHeaders = async () => ({* Return headers that should be passed alongwith (almost) all unauthenticated* `fetch` calls that we make to our API servers.*- * - The client package name.+ * - The client package name.*/export const publicRequestHeaders = () => ({"X-Client-Package": clientPackageName,@@ -52,9 +52,9 @@ export interface PublicAlbumsCredentials {* Return headers that should be passed alongwith public collection related* authenticated `fetch` calls that we make to our API servers.*- * - The auth token.- * - The password protected auth token (if provided).- * - The client package name.+ * - The auth token.+ * - The password protected auth token (if provided).+ * - The client package name.*/export const authenticatedPublicAlbumsRequestHeaders = ({accessToken,diff --git a/web/packages/base/i18n.ts b/web/packages/base/i18n.tsindex cf6e8a14a5..b5d07ef94d 100644--- a/web/packages/base/i18n.ts+++ b/web/packages/base/i18n.ts@@ -59,9 +59,9 @@ const defaultLocale: SupportedLocale = "en-US";** Our custom formatters:*- * - "date": Formats an epoch microsecond value into a string containing the- * year, month and day of the the date. For example, under "en-US" it'll- * produce a string like "July 19, 2024".+ * - "date": Formats an epoch microsecond value into a string containing the+ * year, month and day of the the date. For example, under "en-US" it'll+ * produce a string like "July 19, 2024".*/export const setupI18n = async () => {const localeString = localStorage.getItem("locale") ?? undefined;@@ -129,8 +129,8 @@ export const setupI18n = async () => {i18n.services.formatter?.addCached("date", (locale) => {// The "long" dateStyle://- // - Includes: year (y), long-month (MMMM), day (d)- // - English pattern examples: MMMM d, y ("September 14, 1999")+ // - Includes: year (y), long-month (MMMM), day (d)+ // - English pattern examples: MMMM d, y ("September 14, 1999")//const formatter = Intl.DateTimeFormat(locale, { dateStyle: "long" });// Value is an epoch microsecond so that we can directly pass thediff --git a/web/packages/base/origins.ts b/web/packages/base/origins.tsindex 475e4f2e9f..22e9e4851f 100644--- a/web/packages/base/origins.ts+++ b/web/packages/base/origins.ts@@ -41,10 +41,10 @@ export const apiURL = async (* Return the overridden API origin, if one is defined by either (in priority* order):*- * - Setting the custom server on the landing page (See: [Note: Configuring- * custom server]); or by+ * - Setting the custom server on the landing page (See: [Note: Configuring+ * custom server]); or by*- * - Setting the `NEXT_PUBLIC_ENTE_ENDPOINT` environment variable.+ * - Setting the `NEXT_PUBLIC_ENTE_ENDPOINT` environment variable.** Otherwise return undefined.*/diff --git a/web/packages/media/file-metadata.ts b/web/packages/media/file-metadata.tsindex b9c096c093..f84abbb4ce 100644--- a/web/packages/media/file-metadata.ts+++ b/web/packages/media/file-metadata.ts@@ -44,13 +44,13 @@ import { FileType } from "./file-type";* When the client needs to show a file, it needs to "merge" in 2 or 3 of these* sources.*- * - When showing a shared file, (1) and (3) are merged, with changes from (3)- * taking precedence, to obtain the full metadata pertinent to the file.+ * - When showing a shared file, (1) and (3) are merged, with changes from (3)+ * taking precedence, to obtain the full metadata pertinent to the file.*- * - When showing a normal (un-shared) file, (1), (2) and (3) are merged, with- * changes from (2) and (3) taking precedence, to obtain the full metadata.- * (2) and (3) have no intersection of keys, so they can be merged in any- * order.+ * - When showing a normal (un-shared) file, (1), (2) and (3) are merged, with+ * changes from (2) and (3) taking precedence, to obtain the full metadata.+ * (2) and (3) have no intersection of keys, so they can be merged in any+ * order.** While these sources can be conceptually merged, it is important for the* client to also retain the original sources unchanged. This is because the@@ -76,14 +76,14 @@ export interface Metadata {* This is our best attempt at detecting the time when the photo or live* photo or video was taken.*- * - We first try to obtain this from metadata, using Exif and other- * metadata for images and FFmpeg-extracted metadata for video.+ * - We first try to obtain this from metadata, using Exif and other+ * metadata for images and FFmpeg-extracted metadata for video.*- * - If no suitable metadata is available, then we try to deduce it from- * file name (e.g. for screenshots without any embedded metadata).+ * - If no suitable metadata is available, then we try to deduce it from+ * file name (e.g. for screenshots without any embedded metadata).*- * - If nothing can be found, then it is set to the current time at the- * time of the upload.+ * - If nothing can be found, then it is set to the current time at the time+ * of the upload.*/creationTime: number;/**@@ -143,11 +143,10 @@ export interface Metadata {/*** Mutable private metadata associated with an {@link EnteFile}.*- * - Unlike {@link Metadata}, this can change after the file has been- * uploaded.+ * - Unlike {@link Metadata}, this can change after the file has been uploaded.*- * - Unlike {@link PublicMagicMetadata}, this is only available to the owner- * of the file.+ * - Unlike {@link PublicMagicMetadata}, this is only available to the owner of+ * the file.** For historical reasons, the unqualified phrase "magic metadata" in various* APIs refers to the (this) private metadata, even though the mutable public@@ -180,11 +179,10 @@ export enum ItemVisibility {/*** Mutable public metadata associated with an {@link EnteFile}.*- * - Unlike {@link Metadata}, this can change after the file has been- * uploaded.+ * - Unlike {@link Metadata}, this can change after the file has been uploaded.*- * - Unlike {@link PrivateMagicMetadata}, this is available to all the people- * with whom the file has been shared.+ * - Unlike {@link PrivateMagicMetadata}, this is available to all the people+ * with whom the file has been shared.** For more details, see [Note: Metadatum].*@@ -571,14 +569,14 @@ const putFilesPublicMagicMetadata = async (* Depending on the file type and the upload sequence, this data can come from* various places:*- * - For images it comes from the Exif and other forms of metadata (XMP, IPTC)- * embedded in the file.+ * - For images it comes from the Exif and other forms of metadata (XMP, IPTC)+ * embedded in the file.*- * - For videos, similarly it is extracted from the metadata embedded in the- * file using ffmpeg.+ * - For videos, similarly it is extracted from the metadata embedded in the+ * file using ffmpeg.*- * - From various sidecar files (like metadata JSONs) that might be sitting- * next to the original during an import.+ * - From various sidecar files (like metadata JSONs) that might be sitting next+ * to the original during an import.** These bits then get distributed and saved in the various metadata fields* associated with an {@link EnteFile} (See: [Note: Metadatum]).@@ -692,13 +690,13 @@ export interface ParsedMetadataDate {* ---* Some examples:*- * - "2023" => ("2023-01-01T00:00:00.000", undefined)- * - "2023-08" => ("2023-08-01T00:00:00.000", undefined)- * - "2023-08-23" => ("2023-08-23T00:00:00.000", undefined)- * - "2023-08-23T18:03:00" => ("2023-08-23T18:03:00.000", undefined)- * - "2023-08-23T18:03:00+05:30" => ("2023-08-23T18:03:00.000', "+05:30")- * - "2023-08-23T18:03:00.000+05:30" => ("2023-08-23T18:03:00.000", "+05:30")- * - "2023-08-23T12:33:00.000Z" => ("2023-08-23T12:33:00.000", "Z")+ * - "2023" => ("2023-01-01T00:00:00.000", undefined)+ * - "2023-08" => ("2023-08-01T00:00:00.000", undefined)+ * - "2023-08-23" => ("2023-08-23T00:00:00.000", undefined)+ * - "2023-08-23T18:03:00" => ("2023-08-23T18:03:00.000", undefined)+ * - "2023-08-23T18:03:00+05:30" => ("2023-08-23T18:03:00.000', "+05:30")+ * - "2023-08-23T18:03:00.000+05:30" => ("2023-08-23T18:03:00.000", "+05:30")+ * - "2023-08-23T12:33:00.000Z" => ("2023-08-23T12:33:00.000", "Z")*/export const parseMetadataDate = (s: string,diff --git a/web/packages/new/photos/components/DevSettings.tsx b/web/packages/new/photos/components/DevSettings.tsxindex 03fcf72bcd..48b5d415e4 100644--- a/web/packages/new/photos/components/DevSettings.tsx+++ b/web/packages/new/photos/components/DevSettings.tsx@@ -58,12 +58,12 @@ type ContentsProps = Pick<DevSettingsProps, "onClose">;const Contents: React.FC<ContentsProps> = (props) => {// We need two nested components.//- // - The initialAPIOrigin cannot be in our parent (the top level- // DevSettings) otherwise it gets preserved across dialog reopens- // instead of being read from storage on opening the dialog.+ // - The initialAPIOrigin cannot be in our parent (the top level+ // DevSettings) otherwise it gets preserved across dialog reopens instead+ // of being read from storage on opening the dialog.//- // - The initialAPIOrigin cannot be in our child (Form) because Formik- // doesn't have supported for async initial values.+ // - The initialAPIOrigin cannot be in our child (Form) because Formik+ // doesn't have supported for async initial values.const [initialAPIOrigin, setInitialAPIOrigin] = useState<string | undefined>();diff --git a/web/packages/new/photos/services/changelog.ts b/web/packages/new/photos/services/changelog.tsindex 55fb2d1285..ff42fb0a53 100644--- a/web/packages/new/photos/services/changelog.ts+++ b/web/packages/new/photos/services/changelog.ts@@ -17,11 +17,11 @@ import type { Electron } from "@/base/types/ipc";** On app start, we read the last saved version:*- * - If it is not present, we set it to the current version _without_ showing- * the what's new dialog. This is to handle fresh installs.+ * - If it is not present, we set it to the current version _without_ showing+ * the what's new dialog. This is to handle fresh installs.*- * - If it is present and less than the current version, we show the what's- * new dialog. Otherwise do nothing.+ * - If it is present and less than the current version, we show the what's new+ * dialog. Otherwise do nothing.** The what's new dialog sets the saved version to the current one whenever it* is shown.diff --git a/web/packages/new/photos/services/exif.ts b/web/packages/new/photos/services/exif.tsindex 882da37a53..65b8592b54 100644--- a/web/packages/new/photos/services/exif.ts+++ b/web/packages/new/photos/services/exif.ts@@ -143,9 +143,9 @@ const parseDates = (tags: RawExifTags) => {* the photo was taken. The Exif specification has the following tags related to* photo's date:*- * - DateTimeOriginal- * - DateTimeDigitized (aka "CreateDate")- * - DateTime (aka "ModifyDate")+ * - DateTimeOriginal+ * - DateTimeDigitized (aka "CreateDate")+ * - DateTime (aka "ModifyDate")** DateTimeOriginal is meant to signify best when the original image was taken,* and we use it as the photo's creation date whenever it is present. If not, we@@ -167,9 +167,9 @@ const parseDates = (tags: RawExifTags) => {* Additionally (and optionally), there are three SubSecTime* tags that provide* the fractional seconds (one for each of the above):*- * - SubSecTimeOriginal- * - SubSecTimeDigitized- * - SubSecTime+ * - SubSecTimeOriginal+ * - SubSecTimeDigitized+ * - SubSecTime** Each of which is a string specifying the fractional digits.*@@ -178,9 +178,9 @@ const parseDates = (tags: RawExifTags) => {* local time. This is provided by the three OffsetTime* tags (one for each of* the above):*- * - OffsetTimeOriginal- * - OffsetTimeDigitized- * - OffsetTime+ * - OffsetTimeOriginal+ * - OffsetTimeDigitized+ * - OffsetTime** Each of these is a string of the format*@@ -334,16 +334,16 @@ const parseIPTCDate = (// The library we use (ExifReader) parses them into a usable representation,// which we can use directly. Some notes://- // - There are currently no separate TypeScript types for the IPTC tags,- // and instead they are listed as part of the ExifTags.+ // - There are currently no separate TypeScript types for the IPTC tags, and+ // instead they are listed as part of the ExifTags.//- // - For the date, whenever possible ExifReader parses the raw data into a- // description of the form 'YYYY-MM-DD' (See `getCreationDate` in its- // source code).+ // - For the date, whenever possible ExifReader parses the raw data into a+ // description of the form 'YYYY-MM-DD' (See `getCreationDate` in its+ // source code).//- // - For the time, whenever possible ExifReader parses the raw data into a- // description either of the form 'HH:mm:ss` or `HH:mm:ss±HH:mm` (See- // `getCreationTime` in its source code).+ // - For the time, whenever possible ExifReader parses the raw data into a+ // description either of the form 'HH:mm:ss` or `HH:mm:ss±HH:mm` (See+ // `getCreationTime` in its source code).if (!dateTag) return undefined;let s = dateTag.description;@@ -428,12 +428,12 @@ export type RawExifTags = Omit<ExifReader.ExpandedTags, "Thumbnail" | "xmp"> & {* We wish for a canonical "raw" JSON representing all the Exif data associated* with a file. This goal is tricky to achieve because:*- * - While Exif itself is a standard, with a standard set of tags (a numeric- * id), in practice vendors can use tags more than what are currently listed- * in the standard.+ * - While Exif itself is a standard, with a standard set of tags (a numeric+ * id), in practice vendors can use tags more than what are currently listed+ * in the standard.*- * - We're not just interested in Exif tags, but rather at all forms of- * metadata (e.g. XMP, IPTC) that can be embedded in a file.+ * - We're not just interested in Exif tags, but rather at all forms of metadata+ * (e.g. XMP, IPTC) that can be embedded in a file.** By default, the library we use (ExifReader) returns a merged object* containing all tags it understands from all forms of metadata that it knowsdiff --git a/web/packages/new/photos/services/ml/blob.ts b/web/packages/new/photos/services/ml/blob.tsindex b64036bc34..5a6fa8cc8a 100644--- a/web/packages/new/photos/services/ml/blob.ts+++ b/web/packages/new/photos/services/ml/blob.ts@@ -56,10 +56,10 @@ export const createImageBitmapAndData = async (* The blob from the relevant image component is either constructed using the* given {@link uploadItem} if present, otherwise it is downloaded from remote.*- * - For images it is constructed from the image.- * - For videos it is constructed from the thumbnail.- * - For live photos it is constructed from the image component of the live- * photo.+ * - For images it is constructed from the image.+ * - For videos it is constructed from the thumbnail.+ * - For live photos it is constructed from the image component of the live+ * photo.** Then, if the image blob we have seems to be something that the browser cannot* handle, we convert it into a JPEG blob so that it can subsequently be used todiff --git a/web/packages/new/photos/services/ml/db.ts b/web/packages/new/photos/services/ml/db.tsindex 4473697aec..c7b8774e72 100644--- a/web/packages/new/photos/services/ml/db.ts+++ b/web/packages/new/photos/services/ml/db.ts@@ -12,16 +12,16 @@ import type { LocalFaceIndex } from "./face";** The index related object stores are the following:*- * - "file-status": Contains {@link FileStatus} objects, one for each- * {@link EnteFile} that the ML subsystem knows about. Periodically (and- * when required), this is synced with the list of files that the current- * client knows about locally.+ * - "file-status": Contains {@link FileStatus} objects, one for each+ * {@link EnteFile} that the ML subsystem knows about. Periodically (and when+ * required), this is synced with the list of files that the current client+ * knows about locally.*- * - "face-index": Contains {@link LocalFaceIndex} objects, either indexed- * locally or fetched from remote.+ * - "face-index": Contains {@link LocalFaceIndex} objects, either indexed+ * locally or fetched from remote.*- * - "clip-index": Contains {@link LocalCLIPIndex} objects, either indexed- * locally or fetched from remote.+ * - "clip-index": Contains {@link LocalCLIPIndex} objects, either indexed+ * locally or fetched from remote.** These three stores are keyed by {@link fileID}. The "file-status" contains* book-keeping about the indexing process (whether or not a file needs@@ -33,9 +33,9 @@ import type { LocalFaceIndex } from "./face";** The face clustering related object stores are the following:*- * - "face-cluster": Contains {@link FaceCluster} objects, one for each- * cluster of faces that either the clustering algorithm produced locally.- * It is indexed by the cluster ID.+ * - "face-cluster": Contains {@link FaceCluster} objects, one for each cluster+ * of faces that either the clustering algorithm produced locally. It is+ * indexed by the cluster ID.*/interface MLDBSchema extends DBSchema {"file-status": {diff --git a/web/packages/new/photos/services/ml/index.ts b/web/packages/new/photos/services/ml/index.tsindex f79c4eefff..9d40315ff1 100644--- a/web/packages/new/photos/services/ml/index.ts+++ b/web/packages/new/photos/services/ml/index.ts@@ -48,14 +48,15 @@ class MLState {/*** In-memory flag that tracks if ML is enabled.*- * - On app start, this is read from local storage during {@link initML}.+ * - On app start, this is read from local storage during {@link initML}.*- * - It gets updated when we sync with remote (so if the user enables/disables- * ML on a different device, this local value will also become true/false).+ * - It gets updated when we sync with remote (so if the user+ * enables/disables ML on a different device, this local value will also+ * become true/false).*- * - It gets updated when the user enables/disables ML on this device.+ * - It gets updated when the user enables/disables ML on this device.*- * - It is cleared in {@link logoutML}.+ * - It is cleared in {@link logoutML}.*/isMLEnabled = false;diff --git a/web/packages/new/photos/services/ml/ml-data.ts b/web/packages/new/photos/services/ml/ml-data.tsindex 333ebee55a..51bbb54bf6 100644--- a/web/packages/new/photos/services/ml/ml-data.ts+++ b/web/packages/new/photos/services/ml/ml-data.ts@@ -43,10 +43,10 @@ import { type RemoteFaceIndex } from "./face";** Thus we return two separate results from {@link fetchMLData}:*- * - {@link RawRemoteMLData}: The original, unmodified JSON.+ * - {@link RawRemoteMLData}: The original, unmodified JSON.*- * - {@link ParsedRemoteMLData}: The particular fields that the current client- * knows about, parsed according to their expected structure.+ * - {@link ParsedRemoteMLData}: The particular fields that the current client+ * knows about, parsed according to their expected structure.** When integrating this information into our local state, we use the parsed* version. And if we need to update the state on remote (e.g. if the currentdiff --git a/web/packages/new/photos/services/ml/people.ts b/web/packages/new/photos/services/ml/people.tsindex f7592c4a52..13b73bb378 100644--- a/web/packages/new/photos/services/ml/people.ts+++ b/web/packages/new/photos/services/ml/people.ts@@ -87,10 +87,10 @@ export interface CGroupUserEntityData {** This is similar to the [@link displayFaceID}, the difference being:*- * - {@link avatarFaceID} is the face selected by the user.+ * - {@link avatarFaceID} is the face selected by the user.*- * - {@link displayFaceID} is the automatic placeholder, and only comes- * into effect if the user has not explicitly selected a face.+ * - {@link displayFaceID} is the automatic placeholder, and only comes into+ * effect if the user has not explicitly selected a face.** Also, see: [Note: Mark optional for Zod/exactOptionalPropertyTypes]*/diff --git a/web/packages/new/photos/services/ml/worker.ts b/web/packages/new/photos/services/ml/worker.tsindex 6374eeb8d0..2c12dc6e77 100644--- a/web/packages/new/photos/services/ml/worker.ts+++ b/web/packages/new/photos/services/ml/worker.ts@@ -47,11 +47,11 @@ import type { CLIPMatches, MLWorkerDelegate } from "./worker-types";/*** A rough hint at what the worker is up to.*- * - "init": Worker has been created but hasn't done anything yet.- * - "idle": Not doing anything- * - "tick": Transitioning to a new state- * - "indexing": Indexing- * - "fetching": A subset of indexing+ * - "init": Worker has been created but hasn't done anything yet.+ * - "idle": Not doing anything+ * - "tick": Transitioning to a new state+ * - "indexing": Indexing+ * - "fetching": A subset of indexing** During indexing, the state is set to "fetching" whenever remote provided us* data for more than 50% of the files that we requested from it in the last@@ -88,9 +88,9 @@ interface IndexableItem {** where:*- * - "liveq": indexing items that are being uploaded,- * - "backfillq": index unindexed items otherwise.- * - "idle": in between state transitions.+ * - "liveq": indexing items that are being uploaded,+ * - "backfillq": index unindexed items otherwise.+ * - "idle": in between state transitions.** In addition, MLWorker can also be invoked for interactive tasks: in* particular, for finding the closest CLIP match when the user does a search.diff --git a/web/packages/new/photos/services/remote-store.ts b/web/packages/new/photos/services/remote-store.tsindex 2981e87bdd..f34053b504 100644--- a/web/packages/new/photos/services/remote-store.ts+++ b/web/packages/new/photos/services/remote-store.ts@@ -8,9 +8,9 @@ import { z } from "zod";* The remote store provides a unified interface for persisting varied "remote* flags":*- * - User preferences like "mapEnabled"+ * - User preferences like "mapEnabled"*- * - Feature flags like "isInternalUser"+ * - Feature flags like "isInternalUser"** There are two APIs to get the current state from remote:*diff --git a/web/packages/utils/promise.ts b/web/packages/utils/promise.tsindex 6eefcb9c3b..4c1e426af5 100644--- a/web/packages/utils/promise.ts+++ b/web/packages/utils/promise.ts@@ -30,40 +30,40 @@ export const wait = (ms: number) =>* just use one of them instead of reinventing such a basic and finicky wheel.* Then why write a bespoke one?*- * - "debounce" means that the underlying function will only be called when a- * particular wait time has elapsed since the last call to the _debounced_- * function.- *- * - This behaviour, while useful sometimes, is not what we want always. If- * the debounced function is continuously being called, then the underlying- * function might never get called (since the wait time does not elapse).- *- * - To avoid this starvation, some debounce implementations like lodash- * provide a "maxWait" option, which tells the debounced function to always- * call the underlying function if maxWait has elapsed.- *- * - The debounced functions can trigger the underlying in two ways: leading- * (aka immediate) and trailing which control if the underlying should be- * called at the leading or the trailing edge of the time period.- *- * - "throttle" can be conceptually thought of as just maxWait + leading. In- * fact, this is how lodash actually implements it too. So we could've used- * lodash, except that is a big dependency to pull for a small function.- *- * - Alternatively, pThrottle is a micro-library that provide such a- * "throttle" primitive. However, its implementation enqueues all incoming- * requests to the throttled function: it still calls the underlying once- * per period, but eventually underlying will get called once for each call- * to the throttled function.- *- * - There are circumstances where that would be the appropriate behaviour,- * but that's not what we want. We wish to trigger an async action,- * coalescing multiple triggers into a single one, one per period.- *- * - Perhaps there are other focused and standard library that'd have what we- * want, but instead of spending more time searching I just wrote it from- * scratch for now. Indeed, I've spent more time writing about the function- * than the function itself.+ * - "debounce" means that the underlying function will only be called when a+ * particular wait time has elapsed since the last call to the _debounced_+ * function.+ *+ * - This behaviour, while useful sometimes, is not what we want always. If the+ * debounced function is continuously being called, then the underlying+ * function might never get called (since the wait time does not elapse).+ *+ * - To avoid this starvation, some debounce implementations like lodash provide+ * a "maxWait" option, which tells the debounced function to always call the+ * underlying function if maxWait has elapsed.+ *+ * - The debounced functions can trigger the underlying in two ways: leading+ * (aka immediate) and trailing which control if the underlying should be+ * called at the leading or the trailing edge of the time period.+ *+ * - "throttle" can be conceptually thought of as just maxWait + leading. In+ * fact, this is how lodash actually implements it too. So we could've used+ * lodash, except that is a big dependency to pull for a small function.+ *+ * - Alternatively, pThrottle is a micro-library that provide such a "throttle"+ * primitive. However, its implementation enqueues all incoming requests to+ * the throttled function: it still calls the underlying once per period, but+ * eventually underlying will get called once for each call to the throttled+ * function.+ *+ * - There are circumstances where that would be the appropriate behaviour, but+ * that's not what we want. We wish to trigger an async action, coalescing+ * multiple triggers into a single one, one per period.+ *+ * - Perhaps there are other focused and standard library that'd have what we+ * want, but instead of spending more time searching I just wrote it from+ * scratch for now. Indeed, I've spent more time writing about the function+ * than the function itself.*/export const throttled = (underlying: () => Promise<void>, period: number) => {let pending = 0;