-
Notifications
You must be signed in to change notification settings - Fork 1.1k
fix(ui): handle indexing errors in frontend and enable dev mode API hosting#549
fix(ui): handle indexing errors in frontend and enable dev mode API hosting #549sahil-mangla wants to merge 2 commits into
Conversation
d9550be to
bee202e
Compare
sahil-mangla
commented
Jun 21, 2026
Linter Fix (clang-format): The second force-push was made to wrap a long string literal in src/main.c that exceeded the maximum line length check, which was causing the CI formatting job (lint-format) to fail. No logic changes were introduced.
sahil-mangla
commented
Jun 22, 2026
Hey @DeusData shall i close the PR or should i wait for you to merge it first?
DeusData
commented
Jun 22, 2026
Hey @sahil-mangla, a bit of patience please. At the moment there is a lot of "background work" happening. Coming back to you ASAP :)
DeusData
commented
Jun 22, 2026
Thanks @sahil-mangla — the UI error-banner half is good and we'd like it.
The blocker is the src/main.c change: it removes the CBM_EMBEDDED_FILE_COUNT > 0 guard, so the HTTP server now starts whenever --ui is set, even in the standard binary with no embedded assets. The server binds loopback only (so it's local-only, not a network exposure), but it still turns a documented no-op into a live listener — a behavior-contract change.
Could you split this PR: keep the UI error-handling, and gate the always-start-server behavior behind an explicit opt-in (e.g. a --dev-api flag) rather than removing the asset guard? The UI half can merge as soon as it's separated. 🙏
sahil-mangla
commented
Jun 23, 2026
@DeusData
Thanks for the review and for clarifying the concern.
I agree that removing the CBM_EMBEDDED_FILE_COUNT > 0 guard changes the existing behavior contract for --ui, even if the listener is loopback-only.
I’ll split the changes and update this PR to keep only the UI error-handling improvements. I’ll revert the src/main.c change from this PR and keep the development-server behavior as a separate follow-up, potentially behind an explicit opt-in flag such as --dev-api.
DeusData
commented
Jun 23, 2026
Thanks @sahil-mangla — the StatsTab.tsx error-banner fix itself is good and we'd like it. But the PR currently contains 709 changed files / +3022 lines: ~706 are graph-ui/.npm-cache-local/ npm-cache blobs that got committed, plus scratch/generate_stress_repo.py (which is gitignored and shouldn't be pushed) and some unrelated package-lock.json churn.
Could you reduce this to just the StatsTab.tsx change — remove the .npm-cache-local/ tree and the scratch script, add graph-ui/.npm-cache-local/ to .gitignore so it can't recur, and drop the lock-file churn? Once it's down to the single file, it's good to go. 🙏
76b511a to
c67bf0c
Compare
Signed-off-by: sahil-mangla <manglasahil2017@gmail.com>
c67bf0c to
4a6ad9b
Compare
sahil-mangla
commented
Jun 25, 2026
@DeusData Can you check and verify if any other changes or something looks off to you i will fix them right away or is it all good.
DeusData
commented
Jun 25, 2026
Thanks @sahil-mangla — the frontend fix is a real bug: StatsTab.tsx treated an error status as "done" (data.every(j => j.status !== "indexing")), silently dismissing failures, and splitting "still indexing" from "has errors" is the right fix.
Two things before it lands:
- Title/diff mismatch: the title says "...and enable dev mode API hosting", but the diff only touches
graph-ui/src/components/StatsTab.tsxand.gitignore— there's no backend/dev-mode/API-hosting change here. Please update the title to match what the PR actually does (the error-handling fix + the npm-cache.gitignoreentry) so the merge commit doesn't record a feature that isn't present. If the hosting change was meant to be included, it's missing from the diff. - Test: a small vitest/RTL test for the error path (status
errorrenders the banner and doesn't callonDone) would lock this in.
The .gitignore npm-cache line is unrelated to the fix — fine to keep, just noting. Thanks!
Surface indexing failures in UI and enable backend API startup in development mode
What does this PR do?
This PR addresses a poor user experience when indexing fails, particularly for extremely large repositories that may exhaust available memory.
Changes
Why is this needed?
During investigation of issue #524, I reproduced indexing failures using a synthetic repository containing approximately 200,000 Python files.
The indexing subprocess was terminated by the OS with exit code 137 (SIGKILL / out-of-memory condition). The backend correctly transitioned the job status to "error".
However, the frontend previously treated any non-"indexing" state as completion:
if (data.length > 0 &&
data.every((j) => j.status !== "indexing")) {
onDone();
}
As a result:
This made indexing failures appear as if indexing had silently completed or hung.
This PR surfaces those failures directly in the UI so users receive immediate feedback when indexing fails.
Reproduction
Testing
Manual testing performed
Verified that:
Checklist