Skip to content

fix(graph-ui): surface indexing-job failures instead of silently completing#816

Merged
DeusData merged 2 commits into
mainfrom
distill/549-ui-index-errors
Jul 4, 2026
Merged

fix(graph-ui): surface indexing-job failures instead of silently completing#816
DeusData merged 2 commits into
mainfrom
distill/549-ui-index-errors

Conversation

@DeusData

@DeusData DeusData commented Jul 3, 2026

Copy link
Copy Markdown
Owner

fix(graph-ui): surface indexing-job failures instead of silently completing

Distilled from #549 (thanks @sahil-mangla!).

Refs #524

What does this PR do?

The backend /api/index-status reports status:"error" plus an error message for failed indexing jobs (src/ui/http_server.c, handle_index_status), but the frontend's IndexProgress treated any non-"indexing" state as successful completion. When an indexing job failed (e.g. the indexer subprocess was OOM-killed with exit code 137), the spinner simply vanished: no database, no project in the UI, no error message.

This PR renders a visible error banner instead — failed path + error text + a Dismiss button — while preserving the existing success flow.

Changes beyond the original PR

  • Empty-jobs guard restored. The original PR dropped the data.length > 0 condition, so an empty jobs list would have triggered onDone(). The backend keeps finished jobs listed as "done"/"error" (handle_index_status only skips idle slots, and a job's slot is populated before the POST /api/index 202 reply), so an empty list mid-index can only mean transient state loss (e.g. server restart) — it must not be treated as completion. The guard is re-added with a comment and covered by a test.
  • i18n. The new user-facing strings are routed through the existing i18n system (projects.indexingFailed, common.dismiss) with EN and zh entries, instead of hardcoded English.
  • Tests adapted to backend semantics. The success-flow test now models completion as a "done" entry (matching the backend) instead of an empty list, and assertions reference the i18n messages.

The backend dev-mode asset-hosting change from the original PR is intentionally not included (separate concern; this PR stays scoped to the UI fix).

Testing

  • graph-ui vitest suite: 4 new IndexProgress cases (progress rendering, success flow, empty-jobs guard, error banner + dismiss), all green; full suite green.
  • Red-first verified: on main's StatsTab.tsx the error-banner test fails; the empty-jobs guard test fails on the unguarded variant of the fix.
  • tsc -b clean; no C sources touched.

Checklist

  • Every commit is signed off (git commit -s)
  • Tests pass locally
  • New behavior is covered by tests

DeusData and others added 2 commits July 3, 2026 20:28
…leting

The backend /api/index-status reports status:"error" plus an error
message for failed indexing jobs, but IndexProgress treated any
non-"indexing" state as successful completion: the spinner vanished
with no feedback (e.g. after an OOM-killed indexer subprocess), the
project never appeared, and no error was shown.

Render a visible error banner (path + error text) with a Dismiss
button instead, and keep the success flow unchanged. Beyond the
original PR:

- Restore the empty-jobs guard the PR dropped: the backend keeps
  finished jobs listed as "done"/"error" (handle_index_status only
  skips idle slots), so an empty list mid-index only occurs on
  transient state loss and must not be treated as completion.
- Route the new user-facing strings through the i18n system
  (projects.indexingFailed, common.dismiss; EN + zh entries).
- Cover error banner + dismiss, success flow and the empty-jobs
  guard with vitest cases on the now-exported IndexProgress.

Distilled from #549.

Refs #524

Co-authored-by: sahil-mangla <manglasahil2017@gmail.com>
Signed-off-by: Martin Vogel <martin.vogel.tech@gmail.com>
Signed-off-by: Martin Vogel <martin.vogel.tech@gmail.com>
@DeusData DeusData enabled auto-merge July 3, 2026 22:38
@DeusData DeusData merged commit bfd9b89 into main Jul 4, 2026
15 checks passed
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

1 participant