mirror of
https://github.com/MBombeck/HealthLog.git
synced 2026-11-17 23:52:24 +00:00
Report how many documents the reindex actually queues
The index-all trigger returned Boolean(jobId) while the client typed the field as a number, so the toast read "Indexing true document(s)". The route now answers with the count of live documents still lacking a content index, computed from the same live-scoped counts the usage gauge reads, and an honest 0 when no job was created. OpenAPI schema updated to the integer shape; the hook's type carries a contract note so the wire and the toast cannot drift apart again. Route test pins the number, a component test pins that the toast renders the count and never the word "true". Refs #776
This commit is contained in:
1 parent
4543fa7192
commit
86a3d74187
6 files changed
+290
-8
No files matched your search
@@ -1028,12 +1028,13 @@ export const inboundDocumentPaths: NonNullable<ZodOpenApiObject["paths"]> = {
|
||||
"Enqueues a background job that content-indexes the caller's not-yet-indexed documents (one provider transcription each, bounded + resumable). Gated on the module, a configured vision provider (422 `documents.inbound.providerUnsupported` otherwise), and the existing AI consent (403 otherwise). Returns immediately; the work runs off-request on the queue.",
|
||||
responses: {
|
||||
"200": {
|
||||
description: "Whether a backfill job was enqueued.",
|
||||
description:
|
||||
"How many live documents the enqueued backfill still has to index (0 when everything is indexed or no job was created).",
|
||||
content: {
|
||||
"application/json": {
|
||||
schema: dataEnvelope(
|
||||
z
|
||||
.object({ enqueued: z.boolean() })
|
||||
.object({ enqueued: z.number().int().nonnegative() })
|
||||
.meta({ id: "DocumentReindexResponse" }),
|
||||
"DocumentReindexEnvelope",
|
||||
),
|
||||
|
||||
Reference in new issue
Block a user