π End-to-end encrypted cloud for everything.
Dart 2faandroidauthye2eeencryptionend-to-end-encryptionfluttergolanggoogle-photosgoogle-photos-alternativeiosopensourcephotosprivacyprivacy-toolstypescriptzero-knowledge
es
Manav Rathi96276a123411
diff --git a/web/apps/photos/eslint.config.mjs b/web/apps/photos/eslint.config.mjsindex 55cdf1eea7..8765bfa62e 100644--- a/web/apps/photos/eslint.config.mjs+++ b/web/apps/photos/eslint.config.mjs@@ -9,14 +9,10 @@ export default [* "This rule requires the `strictNullChecks` compiler option to be* turned on to function correctly"*/- "@typescript-eslint/no-unnecessary-boolean-literal-compare": "off","@typescript-eslint/no-unnecessary-condition": "off","@typescript-eslint/no-explicit-any": "off",- "@typescript-eslint/no-unsafe-return": "off",- "@typescript-eslint/no-unsafe-member-access": "off",/** TODO: Disabled as we migrate, try to prune these again */"@typescript-eslint/no-floating-promises": "off",- "@typescript-eslint/no-unnecessary-type-assertion": "off","react-hooks/exhaustive-deps": "off",},},diff --git a/web/apps/photos/src/components/Collections/AlbumCastDialog.tsx b/web/apps/photos/src/components/Collections/AlbumCastDialog.tsxindex 9e255bdab5..f1e300335f 100644--- a/web/apps/photos/src/components/Collections/AlbumCastDialog.tsx+++ b/web/apps/photos/src/components/Collections/AlbumCastDialog.tsx@@ -87,7 +87,7 @@ export const AlbumCastDialogContents: React.FC<AlbumCastDialogProps> = ({// (effectively, only Chrome).//// Override, otherwise tsc complains about unknown property `chrome`.- // @ts-expect-error TODO why is this needed+ // @ts-expect-error TODO: why is this needed// eslint-disable-next-line @typescript-eslint/dot-notationsetBrowserCanCast(typeof window["chrome"] != "undefined");}, []);@@ -131,7 +131,7 @@ export const AlbumCastDialogContents: React.FC<AlbumCastDialogProps> = ({// TODO:// eslint-disable-next-line @typescript-eslint/no-unsafe-assignmentconst obj = JSON.parse(data);- // eslint-disable-next-line @typescript-eslint/no-unsafe-assignment+ // eslint-disable-next-line @typescript-eslint/no-unsafe-assignment, @typescript-eslint/no-unsafe-member-accessconst code = obj.code;if (code) {diff --git a/web/apps/photos/src/components/Collections/GalleryBarAndListHeader.tsx b/web/apps/photos/src/components/Collections/GalleryBarAndListHeader.tsxindex 053e67aee9..b6be9a1ad9 100644--- a/web/apps/photos/src/components/Collections/GalleryBarAndListHeader.tsx+++ b/web/apps/photos/src/components/Collections/GalleryBarAndListHeader.tsx@@ -170,7 +170,7 @@ export const GalleryBarAndListHeader: React.FC<activePerson,showCollectionShare,showCollectionCast,- // TODO-Cluster+ // TODO: Cluster// This causes a loop since it is an array dep// people,]);diff --git a/web/apps/photos/src/components/FileList.tsx b/web/apps/photos/src/components/FileList.tsxindex e0f25a98ae..f75bb4da11 100644--- a/web/apps/photos/src/components/FileList.tsx+++ b/web/apps/photos/src/components/FileList.tsx@@ -365,7 +365,7 @@ export const FileList: React.FC<FileListProps> = ({let sum = 0;const getCurrentItemSize = getItemSize(timeStampList);for (let i = 0; i < timeStampList.length; i++) {- sum += getCurrentItemSize(i)!;+ sum += getCurrentItemSize(i);if (height - sum <= footerHeight) {break;}@@ -718,6 +718,8 @@ export const FileList: React.FC<FileListProps> = ({return ret;}default:+ // TODO:+ // eslint-disable-next-line @typescript-eslint/no-unsafe-returnreturn listItem.item;}};diff --git a/web/apps/photos/src/components/UploadProgress.tsx b/web/apps/photos/src/components/UploadProgress.tsxindex e8a4355ac3..d2a2aec71b 100644--- a/web/apps/photos/src/components/UploadProgress.tsx+++ b/web/apps/photos/src/components/UploadProgress.tsx@@ -523,6 +523,7 @@ const ResultSection: React.FC<ResultSectionProps> = ({// @ts-expect-error Need to add typesconst generateItemKey = (fileID) => {+ // eslint-disable-next-line @typescript-eslint/no-unsafe-returnreturn fileID;};diff --git a/web/apps/photos/src/pages/_app.tsx b/web/apps/photos/src/pages/_app.tsxindex 9d7a2b4dcc..3ae9eb6abe 100644--- a/web/apps/photos/src/pages/_app.tsx+++ b/web/apps/photos/src/pages/_app.tsx@@ -131,9 +131,14 @@ const App: React.FC<AppProps> = ({ Component, pageProps }) => {if (needsFamilyRedirect && savedPartialLocalUser()?.token)redirectToFamilyPortal();- router.events.on("routeChangeStart", (url) => {+ // Creating this inline, we need this on debug only and temporarily. Can+ // remove the debug print itself after a while.+ interface NROptions {+ shallow: boolean;+ }+ router.events.on("routeChangeStart", (url: string, o: NROptions) => {if (process.env.NEXT_PUBLIC_ENTE_TRACE_RT) {- log.debug(() => ["route", url]);+ log.debug(() => [o?.shallow ? "route-shallow" : "route", url]);}if (needsFamilyRedirect && savedPartialLocalUser()?.token) {diff --git a/web/apps/photos/src/services/upload-manager.ts b/web/apps/photos/src/services/upload-manager.tsindex 7df566064a..f4ff2d8e1c 100644--- a/web/apps/photos/src/services/upload-manager.ts+++ b/web/apps/photos/src/services/upload-manager.ts@@ -670,11 +670,11 @@ type UploadItemWithCollectionIDAndName = UploadAsset & {const makeUploadItemWithCollectionIDAndName = (f: UploadItemWithCollection,): UploadItemWithCollectionIDAndName => ({- localID: f.localID!,- collectionID: f.collectionID!,- fileName: (f.isLivePhoto+ localID: f.localID,+ collectionID: f.collectionID,+ fileName: f.isLivePhoto? uploadItemFileName(f.livePhotoAssets!.image)- : uploadItemFileName(f.uploadItem!))!,+ : uploadItemFileName(f.uploadItem!),isLivePhoto: f.isLivePhoto,uploadItem: f.uploadItem,pathPrefix: f.pathPrefix,@@ -776,9 +776,9 @@ const logAboutMemoryPressureIfNeeded = () => {// is the method recommended by the Electron team (see the link about the V8// memory cage). The embedded Chromium supports it fine though, we just need// to goad TypeScript to accept the type.- // eslint-disable-next-line @typescript-eslint/no-unsafe-assignment+ // eslint-disable-next-line @typescript-eslint/no-unsafe-assignment, @typescript-eslint/no-unsafe-member-accessconst heapSize = (performance as any).memory.totalJSHeapSize;- // eslint-disable-next-line @typescript-eslint/no-unsafe-assignment+ // eslint-disable-next-line @typescript-eslint/no-unsafe-assignment, @typescript-eslint/no-unsafe-member-accessconst heapLimit = (performance as any).memory.jsHeapSizeLimit;if (heapSize / heapLimit > 0.7) {log.info(diff --git a/web/apps/photos/src/utils/photoFrame/index.ts b/web/apps/photos/src/utils/photoFrame/index.tsindex c32a382df1..96ed15fa6c 100644--- a/web/apps/photos/src/utils/photoFrame/index.ts+++ b/web/apps/photos/src/utils/photoFrame/index.ts@@ -139,7 +139,7 @@ const createSelectedAndContext = (context:mode == "people"? { mode, personID: activePersonID! }- : { mode, collectionID: activeCollectionID! },+ : { mode, collectionID: activeCollectionID },};} else {// Both mode and context are defined.@@ -152,7 +152,7 @@ const createSelectedAndContext = (context:mode == "people"? { mode, personID: activePersonID! }- : { mode, collectionID: activeCollectionID! },+ : { mode, collectionID: activeCollectionID },};} else {if (selected.context?.mode == "people") {@@ -177,7 +177,7 @@ const createSelectedAndContext = (collectionID: 0,context: {mode: selected.context?.mode,- collectionID: activeCollectionID!,+ collectionID: activeCollectionID,},};}@@ -189,7 +189,7 @@ const createSelectedAndContext = (? undefined: mode == "people"? { mode, personID: activePersonID! }- : { mode, collectionID: activeCollectionID! };+ : { mode, collectionID: activeCollectionID };return { selected, newContext };};diff --git a/web/apps/photos/tests/upload.test.ts b/web/apps/photos/tests/upload.test.tsindex 87bc447531..9a2d2ddfe0 100644--- a/web/apps/photos/tests/upload.test.ts+++ b/web/apps/photos/tests/upload.test.ts@@ -1,3 +1,4 @@+/* eslint-disable @typescript-eslint/no-unsafe-member-access */// TODO: Audit this file/* eslint-disable @typescript-eslint/no-unsafe-call *//* eslint-disable @typescript-eslint/no-unsafe-assignment */diff --git a/web/packages/accounts/pages/credentials.tsx b/web/packages/accounts/pages/credentials.tsxindex 2fa37c73c4..aab0ae6d1b 100644--- a/web/packages/accounts/pages/credentials.tsx+++ b/web/packages/accounts/pages/credentials.tsx@@ -202,7 +202,7 @@ const Page: React.FC = () => {// generated interactive key attributes to verify password.if (keyAttributes) {if (!user.token && !user.encryptedToken) {- // TODO(RE): Why? For now, add a dev mode circuit breaker.+ // TODO: Why? For now, add a dev mode circuit breaker.if (isDevBuild) throw new Error("Unexpected case reached");clearLocalStorage();void router.replace("/");