fix(graph-ui): surface indexing-job failures instead of silently completing#816
Merged
Conversation
…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>
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Add this suggestion to a batch that can be applied as a single commit.This suggestion is invalid because no changes were made to the code.Suggestions cannot be applied while the pull request is closed.Suggestions cannot be applied while viewing a subset of changes.Only one suggestion per line can be applied in a batch.Add this suggestion to a batch that can be applied as a single commit.Applying suggestions on deleted lines is not supported.You must change the existing code in this line in order to create a valid suggestion.Outdated suggestions cannot be applied.This suggestion has been applied or marked resolved.Suggestions cannot be applied from pending reviews.Suggestions cannot be applied on multi-line comments.Suggestions cannot be applied while the pull request is queued to merge.Suggestion cannot be applied right now. Please check back later.
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-statusreportsstatus:"error"plus an error message for failed indexing jobs (src/ui/http_server.c,handle_index_status), but the frontend'sIndexProgresstreated 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
data.length > 0condition, so an empty jobs list would have triggeredonDone(). The backend keeps finished jobs listed as"done"/"error"(handle_index_statusonly skips idle slots, and a job's slot is populated before thePOST /api/index202 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.projects.indexingFailed,common.dismiss) with EN and zh entries, instead of hardcoded English."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-uivitest suite: 4 newIndexProgresscases (progress rendering, success flow, empty-jobs guard, error banner + dismiss), all green; full suite green.main'sStatsTab.tsxthe error-banner test fails; the empty-jobs guard test fails on the unguarded variant of the fix.tsc -bclean; no C sources touched.Checklist
git commit -s)