Commit graph

25276 commits

Author SHA1 Message Date
Manav Rathi 4a69e9260c
[web] Import the scaffolding to sync face embeddings from web_face_v2 (#1402)
This PR cherry picks Neeraj's ML related changes from the web_face_v2
branch.

Similar to https://github.com/ente-io/ente/pull/1399, this gets us one
step closer to integrating ONNX-YOLO with our desktop app. But it is not
currently in a usable state (The web app's functionality remains
untouched).
2024-04-10 16:53:48 +05:30
Manav Rathi 18937581a5
Lint fixes 2024-04-10 16:41:26 +05:30
Neeraj Gupta eefac7fd01
[web] Import the scaffolding to sync face embeddings from web_face_v2
This PR cherry picks Neeraj's ML related changes from the web_face_v2 branch.

Similar to https://github.com/ente-io/ente/pull/1399, this gets us one step
closer to integrating ONNX-YOLO with our desktop app. But it is not currently in
a usable state (The web app's functionality remains untouched).
2024-04-10 16:38:12 +05:30
Manav Rathi 334fd61ea3
[desktop] Code tweaks (#1401)
- Remove top level wrapper
- Document the tray icon
- Update to the new product name where possible
2024-04-10 16:30:54 +05:30
Ashil 3542c8eeff
[Mobile][Photos] Bump up version to 0.8.78 (#1400) 2024-04-10 16:10:54 +05:30
Manav Rathi c73c674ee4
Update to the new product name where possible
(without breaking auto-updates)
2024-04-10 16:07:25 +05:30
Manav Rathi e57e6845a5
Product name 2024-04-10 16:06:04 +05:30
Manav Rathi 3123caea92
Document the tray icon 2024-04-10 16:05:52 +05:30
Manav Rathi 4e3cce51de
Inline 2024-04-10 15:59:57 +05:30
Manav Rathi 127bb9988f
Remove top level wrapper 2024-04-10 15:55:58 +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
Manav Rathi 45d22d5863
Undo concurrency change 2024-04-10 15:34:21 +05:30
Vishnu Mohandas b8be65862f
Use sqlite async for fetching files for gallery (#1397)
## Description

- Migrated from `sqflite` to `sqlite_async` when fetching files for
gallery (Home gallery, Collections page, Archive page & Add photos sheet
gallery ). This has made gallery load significantly faster and has
gotten rid of logs like `NativeAlloc concurrent copying GC freed
392872(19MB) AllocSpace objects, 139(4024KB) LOS objects, 38% free,
38MB/62MB, paused 2.868ms,93us total 324.898ms`. The initial load(100
files) and final load completes instantaneously even before the user
starts interacting with the app which has gotten rid of the jank which
was present before on the final load.
- In the 'Add Photos sheet', it takes time for the gallery to load when
using `sqflite` and images are rendered after this delay. After
migrating to `sqlite_async`, since the gallery loads instantly and
images are rendered right after, the animation of the bottom sheet
coming up became a bit janky. To make it smooth, have added a delay to
load gallery only after the bottom sheet is up fully.
 

## Tests
- [x] Did basic testing to make sure the migrations are working fine.
2024-04-10 15:34:06 +05:30
ashilkn 5879f5ed06 Merge branch 'main' into use_sqlite_async_for_fetching_files_for_gallery 2024-04-10 15:24:23 +05:30
Manav Rathi 71e839e9c4
Remove unused minFaceSize 2024-04-10 14:52:23 +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 03176911ee
[web] [desktop] Refactoring IPC (#1398)
- IPC cleanup and refactoring
- Log on unhandled errors and promise rejections
2024-04-10 14:08:07 +05:30
Manav Rathi 6ec4cc7c89
Log unhandled errors and promise rejections in the desktop app
Test code:

    setTimeout(() => testFunctionSync(), 5000);
    setTimeout(
        () => testFunction().then(() => console.log("done testFunction")),
        10000,
    );

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

    const testFunction = async () => {
        console.log("sleeping");
        await fs.mkdir("/tmp/foo", { recursive: true });
        console.log("woke up");
        throw new Error("Handle me");
    };
2024-04-10 13:35:04 +05:30
Manav Rathi 5eda8fd464
Log in other apps too 2024-04-10 13:09:14 +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
ashilkn d07c4f4d1d Remove code used for debugging/testing 2024-04-10 12:29:01 +05:30
ashilkn 7759d6dcc9 Call super.initState() first in override of initState() in Gallery Widget 2024-04-10 11:47:54 +05:30
ashilkn af7b533016 Add a delay before gallery loads in 'add photos sheet' to make opening of the bottom sheet jank free 2024-04-10 11:38:30 +05:30
Manav Rathi 3c7277a0b1
onMainWindowFocus 2024-04-10 11:16:21 +05:30
ashilkn b9b623e3f7 fix: query in getAllLocalAndUploadedFiles doesn't work if limit is null 2024-04-10 11:11:39 +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 ea18608727
[web] Fix SSR build (#1396)
Fixes the following error on the nightly build

Error: Attempting to assert globalThis.electron in a non-electron
context
at r
(/home/runner/work/ente/ente/web/apps/photos/.next/server/chunks/676.js:1:25418)
        ...

    > Build error occurred
    Error: Failed to collect page data for /gallery
at
/home/runner/work/ente/ente/web/node_modules/next/dist/build/utils.js:1258:15
{
      type: 'Error'
    }
2024-04-10 09:55:28 +05:30
Manav Rathi d828bcb071
[web] Fix SSR build
Fixes the following error on the nightly build

    Error: Attempting to assert globalThis.electron in a non-electron context
        at r (/home/runner/work/ente/ente/web/apps/photos/.next/server/chunks/676.js:1:25418)
        ...

    > Build error occurred
    Error: Failed to collect page data for /gallery
        at /home/runner/work/ente/ente/web/node_modules/next/dist/build/utils.js:1258:15 {
      type: 'Error'
    }
2024-04-10 09:53:30 +05:30
Manav Rathi f893f12f26
[infra] Limit the maximum size of the nginx stdout logs (#1395)
nginx logs to stdout, which is captured by docker and put into a file at
`/var/lib/docker/containers/<nginx-cont-id>/<id>-json.log`

By default, the size of this file is unbounded. Add a maximum limit of 1
GB to this.

References:
- https://docs.docker.com/config/containers/logging/local/
-
https://stackoverflow.com/questions/31829587/docker-container-logs-taking-all-my-disk-space
2024-04-10 09:41:05 +05:30
Manav Rathi e2c894f87f
[infra] Limit the maximum size of the nginx stdout logs
nginx logs to stdout, which is captured by docker and put into a file at
/var/lib/docker/containers/<nginx-cont-id>/<id>-json.log

By default, the size of this file is unbounded. Add a maximum limit of 1 GB to this.

References:
- https://docs.docker.com/config/containers/logging/local/
- https://stackoverflow.com/questions/31829587/docker-container-logs-taking-all-my-disk-space
2024-04-10 09:23:48 +05:30
Vishnu Mohandas 13a78ce84a
[mobile] New translations (#1282)
New translations from
[Crowdin](https://crowdin.com/project/ente-photos-app)
2024-04-10 08:03:42 +05:30
Manav Rathi eebb90fb40
[desktop] Remove GGML (#1394) 2024-04-09 21:36:22 +05:30
Manav Rathi 6a7220ca43
Remove support files for (removed) Windows GGML binary
These were added together with the GGML Windows binary in commit
c3887847bc.
2024-04-09 21:32:41 +05:30
Manav Rathi e8d224c511
Remove stale ggml reference 2024-04-09 21:29:15 +05:30
Manav Rathi 7dccdecff3
Improve log 2024-04-09 21:24:31 +05:30
Manav Rathi 1214b4ddc3
Web enum cleanup 2024-04-09 21:12:00 +05:30
Manav Rathi a813de5617
Only ONNX, web 2024-04-09 20:53:08 +05:30
Manav Rathi 4327cfdb23
Only ONNX, desktop 2024-04-09 20:46:27 +05:30
Manav Rathi b76b57d07e
Bye GGML web 2024-04-09 20:07:11 +05:30
Manav Rathi 67e39daff5
Cleanup 2024-04-09 19:59:31 +05:30
Manav Rathi b02600cb42
Rename 2024-04-09 19:26:20 +05:30
ashilkn 83d122341f Migrate getAllLocalAndUploadedFiles from sqflite to sqlite_async 2024-04-09 17:48:53 +05:30
ashilkn 785beeb9b3 Migrate getFilesInCollection from sqflite to sqlite_async 2024-04-09 17:40:22 +05:30
Vishnu Mohandas 4406307044
Update index.md (#1392) 2024-04-09 17:12:17 +05:30
Vishnu Mohandas c5208d8160
Update index.md 2024-04-09 17:12:06 +05:30
Manav Rathi af07de58f6
More docs 2024-04-09 16:36:23 +05:30
Prateek Sunal cdbb9ab3c3
[fix] include libffi too as it's not included by default (#1387)
## Description

## Tests
2024-04-09 16:24:25 +05:30