Commit graph

422 commits

Author SHA1 Message Date
Manav Rathi 196090152c
Remove an error that is never thrown 2024-04-19 21:39:44 +05:30
Manav Rathi 80a6fe16e7
timeouts 2024-04-19 21:34:35 +05:30
Manav Rathi 32ac31fd44
Start using it 2024-04-19 16:20:20 +05:30
Manav Rathi a9ccec6398
The remaining 2 2024-04-18 21:26:05 +05:30
Manav Rathi 76053c4029
impl 2024-04-18 21:07:00 +05:30
Manav Rathi 14285b66ae
Seep deeper 2024-04-18 18:45:02 +05:30
Manav Rathi 4455bb9595
API on electron side 2024-04-18 18:31:38 +05:30
Manav Rathi 275b763648
Work towards it 2024-04-18 16:18:01 +05:30
Manav Rathi 8a728abffe
Envision the API 2024-04-18 15:31:22 +05:30
Manav Rathi c90cd258ec
Deduce 2024-04-18 15:05:39 +05:30
Manav Rathi 9e35469bdc
Emulate basename and dirname 2024-04-18 14:42:52 +05:30
Manav Rathi e9e17e6ea3
Handle dotfiles 2024-04-18 14:10:43 +05:30
Manav Rathi 9c336a38c0
path mainp 2024-04-18 13:47:46 +05:30
Manav Rathi 518d573add
Improve docs 2024-04-18 13:23:20 +05:30
Manav Rathi 532824b3d5
Spruce types 2024-04-18 12:53:47 +05:30
Manav Rathi 4d80dc3af9
Interface for pending uploads 2024-04-18 11:51:14 +05:30
Manav Rathi acec41f526
More renaming - wip 2024-04-17 20:56:00 +05:30
Manav Rathi ca5b98b8d2
Enum to type - wip 2024-04-17 20:32:21 +05:30
Manav Rathi a22423d039
WIP 2 2024-04-17 17:00:51 +05:30
Manav Rathi 52c35108ca
WIP 1 2024-04-17 15:51:51 +05:30
Manav Rathi 2051ccee46
List files alternate 2024-04-17 14:48:03 +05:30
Manav Rathi ee89506923
Unlegacy isDir 2024-04-17 14:27:48 +05:30
Manav Rathi 4971099da9
Merge 2024-04-17 13:41:10 +05:30
Manav Rathi 184ba91a2d
Refactor 2024-04-17 12:34:00 +05:30
Manav Rathi 27a2b087c7
Elaborate 2024-04-17 12:01:54 +05:30
Manav Rathi 2d5ab044ee
Docs 2024-04-17 11:55:07 +05:30
Manav Rathi 637d830f19
Replace encodelivephoto 2024-04-17 11:51:35 +05:30
Manav Rathi 4b9446a9b0
Create a package to share code between photos and cast 2024-04-17 09:47:28 +05:30
Manav Rathi f775890af7
Rename on the renderer side 2024-04-16 16:35:30 +05:30
Crowdin Bot 0f4624e829 New Crowdin translations by GitHub Action 2024-04-16 01:37:39 +00:00
Manav Rathi 67aacf8391
Replace everywhere 2024-04-15 19:40:50 +05:30
Manav Rathi 8cdb31783b
Enhance 2024-04-15 15:57:57 +05:30
Manav Rathi 9eab93cfdf
Suppress webpack's critical dependency warnings for libheif
Supressing it for now since it obscures other important information in the console.

Upstream issue, which currently doesn't have a workaround:
https://github.com/catdad-experiments/libheif-js/issues/23

Full error message:

     ⚠ ../../node_modules/libheif-js/libheif-wasm/libheif-bundle.js
    Critical dependency: require function is used in a way in which dependencies cannot be statically extracted

    Import trace for requested module:
    ../../node_modules/libheif-js/libheif-wasm/libheif-bundle.js
    ../../node_modules/libheif-js/wasm-bundle.js
    ../../node_modules/heic-decode/index.js
    ../../node_modules/heic-convert/index.js
    ./src/worker/convert.worker.ts
    ./src/utils/comlink/ComlinkConvertWorker.ts
    ./src/services/heic-convert/service.ts
    ...

Refs:
- https://stackoverflow.com/questions/38392697/webpack-umd-critical-dependency-cannot-be-statically-extracted
2024-04-15 13:47:46 +05:30
Manav Rathi 3ea4879cf0
Remove text qualifier
The type already enforces that. And it reads better and the call sites this way.
2024-04-15 12:20:41 +05:30
Manav Rathi 73ef03a5d9
Move read/write whole files into fs 2024-04-15 12:17:33 +05:30
Manav Rathi 18ac361688
Remove unused IPC method 2024-04-14 20:11:25 +05:30
Manav Rathi 28574e516d
[desktop] Fix export related IPC - Part 3/x (#1439) 2024-04-14 19:04:38 +05:30
Manav Rathi eb64a00ed2
Remove unnecessary checks
It is simpler for us to parallel the rm command than our bespoke variant.
2024-04-14 18:22:46 +05:30
Manav Rathi 59b9e3e586
Move into fs 2024-04-14 18:12:19 +05:30
daviddeepan 2a9060bd39 css-alignment-issue-page-gallery 2024-04-14 13:53:00 +05:30
Manav Rathi 7438c3301e
Move mkdirIfNeeded into fs 2024-04-14 10:25:28 +05:30
Manav Rathi 72dd47fa7b
Audit rename 2024-04-14 09:27:52 +05:30
Manav Rathi 297ca09535
Refactor and extract 2024-04-13 21:20:20 +05:30
Manav Rathi 4fbfbf0aa0
Cleanup 2024-04-13 20:53:35 +05:30
Manav Rathi c7757cb08e
Prune more stale overrides 2024-04-13 18:54:15 +05:30
Manav Rathi ce642e12c1
Remove stale disables 2024-04-13 18:50:12 +05:30
Manav Rathi 64231c73f1
[web] Add ESLint to enforce HMR how vite likes it
Configuration changes taken from the vite starter (react-ts).

From the vite docs (https://github.com/vitejs/vite-plugin-react-swc?tab=readme-ov-file#consistent-components-exports)

> For React refresh to work correctly, your file should only export React components.
>
> If an incompatible change in exports is found, the module will be invalidated.
> To make it easier to export simple constants alongside your component the module
> is only invalidated when their value changes.

While we're not currently using vite for our main apps, it would be worthwhile
to write code in a way that a future migration to it is painless if needed.

About the what and the why, the Gatsby docs are illuminating:
https://www.gatsbyjs.com/docs/reference/local-development/fast-refresh/#how-it-works

Some other refs:
- https://github.com/ArnaudBarre/eslint-plugin-react-refresh
- https://github.com/vitejs/vite/discussions/4577#discussioncomment-1161007
- https://github.com/vitejs/vite-plugin-react/issues/34
2024-04-13 18:38:24 +05:30
Manav Rathi 95a0e80c5b
Recreate ML db 2024-04-13 12:46:48 +05:30
Manav Rathi 75e693186a
Inline 2024-04-13 10:14:35 +05:30
Manav Rathi 5082124aa5
Cleanup 2024-04-13 09:44:06 +05:30
Manav Rathi 4055f02a1d
Cleaner 2024-04-13 08:52:37 +05:30
Manav Rathi b32c13fe31
thumb2 2024-04-13 08:48:39 +05:30
Manav Rathi c52fd4383c
Nicer delete 2024-04-13 08:43:01 +05:30
Manav Rathi a86cdb1f1e
Interface 2024-04-13 08:40:08 +05:30
Manav Rathi e8b779745d
put2 2024-04-13 08:33:13 +05:30
Manav Rathi f2aee30f7c
get 2024-04-13 08:18:11 +05:30
Manav Rathi db96a0eb1b
get 2024-04-13 08:12:38 +05:30
Manav Rathi 6d1f8b4728
Blobs it is 2024-04-13 08:04:43 +05:30
Manav Rathi acedbdbe7d
Note 2024-04-13 07:42:24 +05:30
Manav Rathi 6cd795e29c
Create alternate code path 2024-04-13 07:19:28 +05:30
Manav Rathi 3499e47c88
Tweak 2024-04-13 06:47:43 +05:30
Manav Rathi 5ff01c40d8
poc implementation 2024-04-12 21:29:05 +05:30
Manav Rathi 295c0aa82e
Splinter 2024-04-12 21:12:37 +05:30
Manav Rathi 871a0e83cf
Fix 2024-04-12 20:59:15 +05:30
Manav Rathi a56cf55ffa
Remove indirection 2024-04-12 20:58:00 +05:30
Manav Rathi b056cf7f56
Move to newer shared package 2024-04-12 20:55:07 +05:30
Manav Rathi a2a8be3b19
Scaffold the split 2024-04-12 20:52:33 +05:30
Manav Rathi 41472eb87d
Document and structure more 2024-04-12 20:24:48 +05:30
Manav Rathi c691ad2ac1
Document the plan 2024-04-12 20:11:44 +05:30
Manav Rathi 36f9ca2004
Remove unused param 2024-04-12 19:53:23 +05:30
Manav Rathi 65c7cd2c05
[web] Various changes, moving towards fixing desktop caching (#1424)
The overall aim was to get the caching layer trimmed down to a point
where we can plug in OPFS into it for desktop. This PR doesn't have that
specific change, but it's just me gradually changing things, working
towards that.
2024-04-12 16:28:59 +05:30
Manav Rathi b36175a779
user 2024-04-12 15:40:24 +05:30
Manav Rathi c83dc87d5d
Inline the factory 2024-04-12 14:45:03 +05:30
Manav Rathi 495ff99874
Replace enum with TS type 2024-04-12 14:41:33 +05:30
Manav Rathi cd3ff6f878
Delete is not needed outside 2024-04-12 14:32:50 +05:30
Manav Rathi b447dedf83
Cache limit is usused 2024-04-12 14:26:41 +05:30
Manav Rathi bdadc839e0
Remove firefox specific workaround
In a quick (but possibly incomplete) test I wasn't able to reproduce this in an
incognito window. Throwing the error from here has a potential for breaking
things though, I'll try to verify this as I go through the flows individually.
2024-04-12 14:23:56 +05:30
Crowdin Bot ac534cf163 New Crowdin translations by GitHub Action 2024-04-12 01:37:37 +00:00
Manav Rathi 7fa9e924eb
Consolidate 2024-04-11 20:57:54 +05:30
Manav Rathi 320db9f8b7
Fix the putEmbeddings API calls for now 2024-04-11 16:22:38 +05:30
Manav Rathi ff66a2f44c
The ML code runs in workers 2024-04-11 15:27:02 +05:30
Manav Rathi a1d6ef43b4
Roundtrip 2024-04-11 14:37:44 +05:30
Manav Rathi a88f551b6a
WIP IPC API 2024-04-11 13:58:52 +05:30
Manav Rathi 6fc82ff062
[web] Import ONNX-YOLO face changes from the web_face branch (#1399)
Laurens has made the relevant changes to get ONNX-YOLO face detection
working in a manner where the generated embeddings are the same as what
get generated by the corresponding ML stack in the mobile client.

This PR cherry picks his ML related changes from the branch he was
working in, but leaves out the surrounding scaffolding (We cannot merge
that branch directly because it relies on wasm that we don't need and
don't want to commit to main).

At this point this functionality is correct but not usable - the next
step will be to tie this to the ONNX runtime that we already have on the
Node.js layer of our desktop app.

**Tests**

- yarn dev + smoke test
- yarn build + smoke test
- yarn lint
2024-04-10 15:36:03 +05:30
laurenspriem 3eb95bd822
Import ONNX-YOLO face changes from the web_face branch
Laurens has made the relevant changes to get ONNX-YOLO face detection working in
a manner where the generated embeddings are the same as what get generated by
the corresponding ML stack in the mobile client.

This commit cherry picks his ML related changes from the branch he was working
in, but leaves out the surrounding scaffolding (We cannot merge that branch
directly because it relies on wasm that we don't need and don't want to commit
to main).

At this point this functionality is correct but not usable - the next step will
be to tie this to the ONNX runtime that we already have on the Node.js layer of
our desktop app.
2024-04-10 14:41:59 +05:30
Manav Rathi e0fe018f34
Log on unhandled errors and promise rejections
Test code:

    useEffect(() => {
        setTimeout(() => testFunctionSync(), 5000);
    }, []);

    useEffect(() => {
        testFunction();
    }, []);

    const testFunctionSync = () => {
        console.log("sleeping not");
        // sleep(2000);
        console.log("woke up not");
        throw new Error("Handle me");
    };

    const testFunction = async () => {
        console.log("sleeping");
        sleep(2000);
        console.log("woke up");
        throw new Error("Handle me");
    };

Refs:
- https://developer.mozilla.org/en-US/docs/Web/API/Window/unhandledrejection_event
- https://github.com/megahertz/electron-log/blob/master/src/renderer/lib/RendererErrorHandler.js
2024-04-10 13:05:00 +05:30
Manav Rathi af79f4f0c9
Audit app update functions 2024-04-10 12:32:43 +05:30
Manav Rathi 3c7277a0b1
onMainWindowFocus 2024-04-10 11:16:21 +05:30
Manav Rathi 170aef9b30
Rename 2024-04-10 11:06:18 +05:30
Manav Rathi 8bcf77b7f7
IPC keys 2024-04-10 11:03:36 +05:30
Manav Rathi 18606b2358
IPC cleanup 2024-04-10 10:18:06 +05:30
Manav Rathi a813de5617
Only ONNX, web 2024-04-09 20:53:08 +05:30
Manav Rathi b76b57d07e
Bye GGML web 2024-04-09 20:07:11 +05:30
Manav Rathi 544e6be3fd
Document 2024-04-09 15:38:59 +05:30
Manav Rathi 4f76cfb912
[web] New translations (#1380)
New translations from
[Crowdin](https://crowdin.com/project/ente-photos-web)
2024-04-09 13:23:39 +05:30
Manav Rathi b0fbd68d27
Fix errors 2024-04-09 13:13:37 +05:30
Manav Rathi 9127c48787
Remove duplicate files 2024-04-09 12:45:37 +05:30
Manav Rathi 5edca461f7
Final touches 2024-04-09 12:39:37 +05:30
Manav Rathi 4aa3d68e36
Wrap the assertion 2024-04-09 12:36:25 +05:30
Manav Rathi 56ce5c0b0e
More transition 2024-04-09 12:17:33 +05:30
Manav Rathi d441418b5b
Remove deprecated loggers 2024-04-09 12:06:46 +05:30
Manav Rathi 0d0e20f7c4
More manual tweaks 2024-04-09 11:58:44 +05:30
Manav Rathi 1dc8f4617e
log.error regex replacement
- logError\(e, (".+")\);
- log.error($1, e);

+ a whole bunch of manual tweakings
2024-04-09 11:32:34 +05:30
Manav Rathi 72dea7eca6
Start using it 2024-04-09 09:53:28 +05:30
Manav Rathi 54a973c457
Expose on the globalThis
Note that the filename of the .d.ts has to be different from any existing file!
https://stackoverflow.com/questions/59728371/typescript-d-ts-file-not-recognized
2024-04-09 09:37:43 +05:30
Crowdin Bot 7dee92f44e New Crowdin translations by GitHub Action 2024-04-09 01:37:23 +00:00
Manav Rathi 59bda25be2
Fix log entry format 2024-04-08 21:00:05 +05:30
Manav Rathi 92a3650696
Dedup comlink 2024-04-08 20:53:27 +05:30
Manav Rathi a1c9ceae6b
Add temporary gateways 2024-04-08 20:47:47 +05:30
Manav Rathi 5339b1aa89
Merge 2024-04-08 20:39:53 +05:30
Manav Rathi 0be549c91b
Transition 2024-04-08 20:21:49 +05:30
Manav Rathi 826cacd6bf
Reroute 2024-04-08 20:00:24 +05:30
Manav Rathi 90a770c619
WIP 2024-04-08 18:09:08 +05:30
Manav Rathi f4f041552f
Move electron API types to lower layer 2024-04-08 16:51:48 +05:30
Manav Rathi 18e47b3d4e
Synchronize startup banners 2024-04-08 14:09:59 +05:30
Manav Rathi 84d21984e0
Test complete
Tested logging from both worker (in web app) and when running in Electron.

Refs:
- https://github.com/GoogleChromeLabs/comlink/issues/506
- https://github.com/GoogleChromeLabs/comlink/issues/568
2024-04-08 13:16:50 +05:30
Manav Rathi da9a704094
fixing logging in workers WIP 2 2024-04-08 12:52:10 +05:30
Manav Rathi a96ad6dfa2
WIP 2024-04-08 12:40:03 +05:30
Crowdin Bot b3842dab04 New Crowdin translations by GitHub Action 2024-04-08 04:09:44 +00:00
Manav Rathi 0b3165b812
Remove unused 2024-04-07 10:58:19 +05:30
Manav Rathi 99579fbf51
Inline 2024-04-07 10:56:15 +05:30
Manav Rathi 75d041dd9c
Inline 2024-04-07 10:53:34 +05:30
Manav Rathi d992085dbd
Inline 2024-04-07 10:49:31 +05:30
Manav Rathi cb6cfee9a3
Inline 2024-04-07 10:49:04 +05:30
Manav Rathi 60321111c2
Remove isCanvasBlocked checker
We don't really support running without canvas access, we need it for image
manipulation. The firefox feature seems poorly implemented -
https://bugzilla.mozilla.org/show_bug.cgi?id=1429865 - and if someone _really_
wishes to not add an exclusion for our open source web app, then they can
download our desktop app.
2024-04-07 10:45:30 +05:30
Manav Rathi 49b5bff042
Inline 2024-04-07 10:29:00 +05:30
Manav Rathi 7c0ab6dd8a
Remove l11n unsafe direct string manipulation 2024-04-07 10:23:20 +05:30
Manav Rathi 01e6e79819
Cannot be a compile time constant 2024-04-07 10:18:30 +05:30
Manav Rathi e5b2d737b4
Clean up environment detection code 2024-04-07 10:03:28 +05:30
Crowdin Bot e779ae5189 New Crowdin translations by GitHub Action 2024-04-06 07:12:09 +00:00
Manav Rathi 6bff42ad9b
Remove unused keys 2024-04-06 12:11:29 +05:30
Manav Rathi 121df66ada
Cleanup 2024-04-06 11:19:14 +05:30
Manav Rathi a98a29800b
[web] Bundle translations but load them lazily
Refs:
- https://github.com/i18next/i18next-resources-to-backend
- https://stackoverflow.com/questions/77251750/how-to-implement-lazy-loading-translations-in-i18next-with-react
- https://github.com/i18next/react-i18next/issues/525
- https://gist.github.com/SimeonC/6a738467c691eef7f21ebf96918cd95f
- https://www.i18next.com/overview/plugins-and-utils
2024-04-06 11:06:29 +05:30
Manav Rathi 10b0d9f533
Fix the yarn lint 2024-04-05 21:22:44 +05:30
Manav Rathi 411984ebdc
Fix lint errors 2024-04-05 21:09:47 +05:30
Manav Rathi cf27f3236c
lint-fix 2024-04-05 20:48:23 +05:30
Manav Rathi 42a59f2fb5
Consolidate and deduplicate 2024-04-05 20:35:22 +05:30
Manav Rathi 7807d3a413
Inline 2024-04-05 20:03:23 +05:30
Manav Rathi 461430a972
Move up from shared 2024-04-05 20:01:28 +05:30
Manav Rathi fe6215d0fd
Replace context entry with useRouter 2024-04-05 19:58:45 +05:30
Manav Rathi e680970cdf
Inline 2024-04-05 19:58:45 +05:30
Manav Rathi 356ad6f004
Use regular link
Removing unnecessary dependencies on next specific components
2024-04-05 19:58:45 +05:30
Manav Rathi fa7cbaea18
Remove custom _document
Looking towards a longer term transition out of next
2024-04-05 10:09:37 +05:30
Manav Rathi 9785bbcb26
We don't have full web app support yet
Plus, Apple doesn't do much for PWAs anyway. One reason for removing this until
we test it out in actuality is because there were reports of the semi-PWA
caching causing issues.
2024-04-05 09:38:48 +05:30
Manav Rathi 2c098904fb
Inline 2024-04-05 09:13:38 +05:30
Manav Rathi a68dce35f6
Remove unused knob 2024-04-05 09:08:56 +05:30
Manav Rathi 1d0f30ad91
These values were never customized 2024-04-05 09:08:02 +05:30
Manav Rathi d9d03d8451
Add schema validation of the response 2024-04-04 16:12:39 +05:30
Manav Rathi 29550317f7
Enable the jsx-runtime plugin for vite's ESLint
This prevents it complaining about a missing React import.

Enabling this is recommended by the vite starter itself:

> Install
  [eslint-plugin-react](https://github.com/jsx-eslint/eslint-plugin-react) and
  add `plugin:react/recommended` & `plugin:react/jsx-runtime` to the `extends`
  list
2024-04-04 14:46:41 +05:30
Manav Rathi 935e47fbca
Fix the payments eslint 2024-04-04 14:10:16 +05:30
Manav Rathi ff6d0d32cf
Remove unused 404 handler
The default appType == 'spa' in vite redirects all (unclaimed) paths to /index.html.

If needed, this can be disabled:
https://stackoverflow.com/questions/69701743/how-can-i-configure-vites-dev-server-to-give-404-errors/69711988#69711988
2024-04-04 13:58:30 +05:30
Manav Rathi 87dc7d76ca
Remove middleman package, to get it to compile 2024-04-04 11:36:20 +05:30
Manav Rathi 4255e48abb
Convert payments app to use Vite - Part 1
(Doesn't compile)
2024-04-04 11:10:34 +05:30
Manav Rathi f10f751a2f
Inline local storage calls
The methods are trivial, and we cannot centralize the keys since they will be
different for different apps. So an abstraction for this is not beneficial.

Also move the next specific dev build check to @/next
2024-04-03 14:21:11 +05:30
Manav Rathi d28daece8a
ignorePatters seems to be inherited (as we wished) when extending 2024-04-03 13:48:41 +05:30
Manav Rathi 24bce96d71
Shorten 2024-04-03 13:44:30 +05:30
Manav Rathi ad6dea2ecb
prettier markdown 2024-04-03 13:39:44 +05:30
Manav Rathi 212dcfb88a
Tinker 2024-04-03 13:32:05 +05:30
Manav Rathi e2fd88bff0
Remove (possibly) unnecessary tsconfigRootDir
Let's see what breaks
2024-04-03 13:15:12 +05:30
Manav Rathi 764b6bf2f3
Move react setup to react specific file 2024-04-03 13:02:09 +05:30
Manav Rathi 5c1ed5be8f
Restructure eslint config 2024-04-02 20:44:57 +05:30
Manav Rathi 14fde54d87
Not really 2024-04-02 20:04:23 +05:30
Manav Rathi 26b35cec9e
Merge @/ui into @/next 2024-04-02 19:58:42 +05:30
Manav Rathi cc90dd7ba5
[web] Enable Russian
The translation percentage of Russian in crowdin is now 100%, it's time to
enable it as an option in the UI.

A big thank you to the translators.
2024-04-02 17:16:33 +05:30
Manav Rathi 0e1bdfe07e
Support arbitrary ReactNodes as title 2024-04-02 14:38:37 +05:30
Manav Rathi 25e762ba57
Remove mui from list of transpiled packages
- I can't see this mentioned anywhere in the docs
- Removing it didn't break anything dev / preview
2024-04-01 17:13:06 +05:30
Manav Rathi 9b27cac465
Remove @emotion/server
It is not mentioned as a dependency in the SSR page

> For v10 and above, SSR just works in Next.js.
>
> https://emotion.sh/docs/ssr

Tested by - yarn dev, yarn preview:photos
2024-04-01 16:05:17 +05:30
Manav Rathi 7183a8b493
[web] Remove emotion caches
This is no longer needed for emotion > 10

> For v10 and above, SSR just works in Next.js.
>
> https://emotion.sh/docs/ssr#nextjs

Tested with

- yarn dev:*
- yarn preview:*

This change screws up the CSS in places in dev mode though.
2024-03-30 20:56:38 +05:30
Manav Rathi 949780d1e8
[cast] Use the placeholder as the placeholder, not as the label 2024-03-29 12:15:06 +05:30
Manav Rathi 478435f806
Use :3001 for all the aux services 2024-03-28 11:42:59 +05:30
Manav Rathi 8f0ef055c5
[web] Make the imported payments code feel at home in the new monorepo
- Use the shared yarn monorepo configuration
- styled-components => emotion (since that's what the rest of the code uses)
- Remove Sentry (since it's gone elsewhere)
2024-03-28 11:40:22 +05:30
Manav Rathi 48a726885f
Fix typo in comment 2024-03-26 21:45:21 +05:30
Manav Rathi ac97d65c12
Remove one copy of duplication from IPC types 2024-03-26 21:45:21 +05:30
Manav Rathi 147d79c64f
[web][photos] Fix infinite loop on half-logins (#1197)
Fix an infinite loop of navigation under the following conditions: key
is valid
but token is not present.

Fix is to match the condition used in both gallery

    if (!key || !token) {

and the root page.

They seemed to have diverged in commit
c3304571a9.

Was able to reproduce this when launching the desktop app such that the
key was
picked up (possibly from a prior installation) from the secure keychain,
but the
token was not found. I feel this is also a fix for a similar navigation
loop
recently reported by QA but unreproducible so far.
2024-03-25 19:11:07 +05:30
Manav Rathi 4b7155dd13
Match the condition in one more place 2024-03-25 17:44:27 +05:30
LI-NA b98da635b6 [web] Change the command to fetch the git SHA
To make the git command work on Windows, changed it to use different commands depending on the platform of the OS.
2024-03-25 20:10:38 +09:00
Manav Rathi f8a36852a6
Prepare for test 2024-03-25 15:39:29 +05:30
Manav Rathi 892bf852a5
Convert remaining upload functions 2024-03-25 15:29:39 +05:30
Manav Rathi f53b1361e8
Move file related functions 2024-03-25 15:09:51 +05:30
Manav Rathi 4261624da5
Handle rest of watch related functions 2024-03-25 14:03:20 +05:30
Manav Rathi 186e76c62b
Move add/remove watch functions to preload 2024-03-25 13:49:48 +05:30
Manav Rathi 96ea53face
preload / watch - part 1
The change event was not being used (since
dca542e781), so also remove that dead code.
2024-03-25 13:31:28 +05:30
Manav Rathi 67468c6ff9
Move the selection dialogs 2024-03-25 13:02:06 +05:30
Manav Rathi e8acbd8c9f
Convert the other conversion functions 2024-03-25 12:45:21 +05:30
Manav Rathi 2522da2b5e
Handle runFFMPEGCmd in preload 2024-03-25 12:32:57 +05:30
Manav Rathi dd7e87274a
Handle set/getEncryptionKey in preload 2024-03-25 12:19:19 +05:30
Manav Rathi 106ba270fe
Handle ML related functions in updated preload 2024-03-25 12:09:11 +05:30
Manav Rathi d3093809d6
Inline more into preload 2024-03-23 20:25:56 +05:30
Manav Rathi 81ba5379c9
Move checkExistsAndCreateDir out of preload 2024-03-23 20:06:27 +05:30
Manav Rathi f21dc84840
Switch to async fs.exists
We cannot expose the sync version over the context bridge - the node:fs module
is not available to the preload script under context isolation.
2024-03-23 19:59:47 +05:30
Manav Rathi b1d0909675
EXtract common queueProcessor 2024-03-23 18:49:22 +05:30
Manav Rathi 7704b902c4
Extract shared function 2024-03-23 18:46:20 +05:30
Manav Rathi bdb2a22863
Extract shared function 2024-03-23 18:44:30 +05:30
Manav Rathi 47a7042d55
Remove dead code from cast 2024-03-23 18:38:31 +05:30
Manav Rathi a5c3aff54b
Expose an fs.exists over the context bridge 2024-03-23 18:28:22 +05:30
Manav Rathi 7a3209ebf6
Fix preload.ts - Part x/x 2024-03-23 16:13:16 +05:30
Manav Rathi d297465ea6
Dedup 2024-03-22 20:48:57 +05:30
Manav Rathi 03bad54bce
Remove from the web side 2024-03-22 17:41:32 +05:30
Manav Rathi 8391e7edfc
Start migrating from promise-fs 2024-03-22 15:13:37 +05:30
Manav Rathi 3a6c7b2dcd
Remove unused sendNotification IPC 2024-03-19 19:18:05 +05:30
Manav Rathi e00b8fd2f1
Remove unused IPC for getPlatform 2024-03-19 19:18:05 +05:30
Manav Rathi eeaa5165ab
Remove custom cache directory
From discussions, it seems that it was pre-emptively added but not specifically
requested by a customer. We can bring this back later if needed, or at least
offer better options to clean it, but for now I'm pruning the IPC surface to
reduce the amount of work needed for handling contextIsolation and sandboxing.
2024-03-19 19:18:04 +05:30
Manav Rathi d80fad6cf1
Remove unused vscode extension support
This doesn't belong in the repo even if were used
https://github.com/standard/vscode-standard
2024-03-19 19:17:01 +05:30
Manav Rathi b7b33eba4a
Switch to contextBridge - Part 1 2024-03-19 19:17:01 +05:30
Manav Rathi f85f220c1d
Web Passkey Recovery (#1047)
## Description

* Adds passkey recovery feature parity from #1013

## Tests
2024-03-17 11:44:13 +05:30
Manav Rathi 26b162c8dc
[web] Allow running the build outside of a git repository
This was found useful by @Bramas when building a Dockerfile of the web app
itself. See https://github.com/ente-io/ente/pull/1065.

Now, the GIT_SHA environment variable can just be undefined if we're not in a
git repository, and the code using it deals with that case explicitly.

**Tested by**

Temporarily inverted the isDevBuild flag, tehn

1. Ran the build normally and verified that the SHA continued to appear in the logs.

2. Ran the build after copying to a standalone folder without an associated git
   repository and verified that the SHA was skipped without causing the build to
   fail.
2024-03-13 11:15:12 +05:30
httpjamesm d9b1081849
Merge branch 'main' into feature/web-passkey-recovery 2024-03-12 13:57:57 -04:00
Manav Rathi 5d01931402
Retain -web suffix to allow disambiguating between main and renderer process 2024-03-12 14:06:42 +05:30
Manav Rathi 206ad46950
Remove CRASH_REPORTING key 2024-03-12 13:59:45 +05:30
Manav Rathi 70cddfdf0b
[web] Remove Sentry
Sentry has a measurable impact on page load, a metric that I'm keen to
improve. Apparently by default it loses us 8-9 page speed points, though that
can be reduced to 3-4
(https://github.com/getsentry/sentry-javascript/issues/9179).

All of this is doable, but there are bigger tasks to deal with. This is not to
say that Sentry won't be useful again at some point, when we have time to deal
with it better. But right now, we discussed that it's just better to remove
Sentry instead of piling on to the sunk cost.
2024-03-12 13:24:33 +05:30
httpjamesm 267bd56285
feat: twoFactorType prop with default in recovery page 2024-03-11 13:52:46 -04:00
httpjamesm 83a17e4d11
feat: default to totp 2024-03-11 13:40:49 -04:00
httpjamesm cbdb4907cf
feat: two factor type 2024-03-11 13:30:11 -04:00
httpjamesm 048162ba1f
fix: resp data 2024-03-11 13:09:27 -04:00
httpjamesm 2928cae79a
feat: configurePasskeyRecovery in service 2024-03-11 13:04:53 -04:00
httpjamesm 1d4f92c39b
feat: isPasskeyRecoveryEnabled in service 2024-03-11 13:03:15 -04:00
Manav Rathi bd84b54c5a Capitalize Ente 2024-03-11 13:27:17 +05:30
Manav Rathi af4eaac158 Remove duplicate favicon link 2024-03-11 13:26:15 +05:30
Manav Rathi d57e59493b Fix formatting issues 2024-03-06 15:51:26 +05:30
aakankshabhende 4a579a93bb Added selectAll checkbox to select all files on a day
Signed-off-by: aakankshabhende <aakanksha0407@gmail.com>
2024-03-05 10:42:57 +05:30
Manav Rathi 918e70b516 Update links to GitHub from within the apps 2024-03-03 18:08:11 +05:30
Manav Rathi e15c7e1642 Move into web/ 2024-03-01 12:21:07 +05:30