Skip to content

armgit / ente

Public Imported from GitHub
0

πŸ’š End-to-end encrypted cloud for everything.

Fix status during live uploads

Manav Rathid96d4773cfee
diff --git a/web/packages/new/photos/services/ml/index.ts b/web/packages/new/photos/services/ml/index.ts
index e4c56a4569..53a57a3b73 100644
--- a/web/packages/new/photos/services/ml/index.ts
+++ b/web/packages/new/photos/services/ml/index.ts
@@ -479,13 +479,19 @@ const getMLStatus = async (): Promise<MLStatus> => {
const { indexedCount, indexableCount } = await indexableAndIndexedCounts();
+ // During live uploads, the indexable count remains zero even as the indexer
+ // is processing the newly uploaded items. This is because these "live
+ // queue" items do not yet have a "file-status" entry.
+ //
+ // So use the state of the worker as a guide for the phase, not the
+ // indexable count.
+
let phase: MLStatus["phase"];
- if (indexableCount > 0) {
- const state = await (await worker()).state;
- phase =
- state == "indexing" || state == "fetching" ? state : "scheduled";
+ const state = await (await worker()).state;
+ if (state == "indexing" || state == "fetching") {
+ phase = state;
} else {
- phase = "done";
+ phase = indexableCount > 0 ? "scheduled" : "done";
}
return {