Repository navigation
fix(ui): show health checks as they finish instead of after the slowest - #870
Merged
Merged
Conversation
The Doctor page waited for the whole `doctor --json` run before showing
anything. One slow check, such as plugin checks waiting on a native CLI
that does not answer, kept the page on a skeleton for 30 seconds, and the
server's 30-second write timeout could cut the response off entirely.
`doctor --json` now prints each check as a {"check": ...} line when the
internal _SKILLSHARE_DOCTOR_STREAM variable is set, before its usual
result. The new GET /api/doctor/stream relays those lines as Server-Sent
Events and sends the full result as `done`; it has no write deadline and
stops doctor when the client leaves. The page shows checks as they
arrive and replaces them with the final result.
The audit, diff and doctor streams send an `error` event with the reason, but the shared EventSource helper treated it like a dropped connection and showed only a generic message. It now uses the reason the server sent, and keeps the generic message for a real disconnect.
…igured The hooks check loaded the full hooks inventory, which also scans unmanaged native and Git hooks twice: about 12 git calls even with no hooks configured, none of which doctor reports. Doctor now reads the hooks section first and previews a sync only when there is something to check.
Codex Review Summary: ✅ CompletedThis comment shows the latest Codex review activity on this pull request.
ℹ️ About Codex in GitHubYour team has set up Codex to review pull requests in this repo. Reviews are triggered when you
Codex reacts with 👀 while any review is running, comments if it has suggestions, and reacts with 👍 once all reviews finish with no findings. |
This was referenced Nov 12, 2026
Merged
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.
Type
proposals/only — see CONTRIBUTING.md)approvedlabel)Linked Issue
None. Found while using the dashboard: the Doctor page showed a skeleton for about 30 seconds.
What and why
skillshare doctor -gon an affected machine took 30.2s wall time but only 1.4s of CPU. The plugin check waited out its 30-second budget on native CLIs that never answered. The Doctor page could not show anything until the whole run finished, and the server's 30-second write timeout sat right at that edge, so/api/doctorwas sometimes cut off.fix(ui)).doctor --jsonprints each check as a{"check": ...}line when the internal_SKILLSHARE_DOCTOR_STREAMvariable is set; without it the output is unchanged. NewGET /api/doctor/streamrelays them as Server-Sent Events, then sends the full result asdone. It has no write deadline and stops doctor when the client leaves. The Doctor page shows checks as they arrive, with a skeleton row while more are coming. Run again keeps the previous result on screen until the new one is done.GET /api/doctorstays for API users and is now bound to the request context.fix(ui)). The audit, diff and doctor streams send anerrorevent with a reason, butcreateSSEStreamhandled it like a dropped connection and showed a generic message. It now shows the server's reason and keeps the generic message for a real disconnect.fix(doctor)). The check loaded the full hooks inventory, which runsgit versionand fivegit configreads twice even with no hooks. Doctor now reads the hooks section first (newhooks.Service.Source()) and previews a sync only when there is something to check. The dashboard Hooks page still usesList().Docs: the Web API table in
website/docs/reference/commands/ui.mdand its four translations list the new endpoint.Verification
make checkin the devcontainer: passed.pnpm run build,pnpm lint(0 errors; the 53 warnings already exist onmain),pnpm test(888 passed).relayDoctorChecksunit test,TestDoctor_JSON_StreamPrintsEachCheckBeforeResult,TestDoctor_HooksNotConfiguredRunsNoGit(failed before the fix),sseStream.test.ts(failed before the fix), and adoctorFromCheckscount test.skillshare uiwith doctor's hook-related Git calls slowed by one second each. The page showed 17 checks within 1s and the remaining checks and version box at 8.8s.Not covered
handleDoctorStream: it runsos.Executable(), which is the test binary undergo test. The relay is unit-tested, and the CLI stream format is integration-tested.Checklist
make check) — for code changes