surface contextual Docker error when daemon is unreachable#148
Open
rx18-eng wants to merge 2 commits into
Open
surface contextual Docker error when daemon is unreachable#148rx18-eng wants to merge 2 commits into
rx18-eng wants to merge 2 commits into
Conversation
Signed-off-by: rx18-eng <remopanda78@gmail.com>
Signed-off-by: rx18-eng <remopanda78@gmail.com>
Contributor
Author
|
@pavlenex would appreciate your review whenever you have time ! |
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.
Body
before this, when docker quit while sv2-ui was running, the dashboard just said "Mining services are stopped." and the start mining button silently failed. now it tells you docker is the actual problem and shows the contextual error from the backend.
two changes:
/api/statusnow returnsdocker: { reachable: boolean }. when false, the dashboard shows a red "Docker isn't running" banner. wrapped the ping in a 500msPromise.raceso a slow daemon can't stall the status response.handleStartMiningwas throwing away the response body when/api/restart500'd. now it parses the body the same wayReviewStart.tsx:73-77already does in the wizard, and shows the contextual error string verbatim in a red "Could not start mining services" banner.priority on the configured-but-stopped state: docker-down > start-error > existing "stopped" banner. the Start Mining button stays in all three so the user can retry once docker is back.
tested in WSL with native docker:
sudo systemctl stop docker docker.socket→ red banner appears within ~10s. clicked Start Mining with docker still down → 500 with the contextual error (visible in screenshots).sudo systemctl start docker→ banner returns to the blue stopped state and Start Mining works again.not in this PR: settings page has the same gap on its start/stop controls, happy to do that as a follow-up if you want. no UI tests for the banner branching because there's no jsdom/testing-library in the repo today.
closes #144