fix(web): stop reporting "no update" when the update check could not run - #483
fix(web): stop reporting "no update" when the update check could not run#483ChuckBuilds wants to merge 1 commit into
Conversation
check-update returned update_available=False whenever git failed. The banner
is the only route to the update button, so a checkout git refuses to touch
looked exactly like a current one -- permanently, with nothing on screen to
act on and only a log line recording why.
The common cause is an install performed as root. scripts/install/one-shot-install.sh
clones into ${HOME}/LEDMatrix, never consults SUDO_USER, and contains no chown
at all, while its own error text suggests running the whole thing under sudo.
The result is a root-owned checkout, and on a rig this is what every git
command in it does:
fatal: detected dubious ownership in repository at '...'
including the fetch this endpoint runs. Verified on real hardware rather than
assumed.
A failed check now reports check_failed with a message the user can act on --
for dubious ownership, the chown that fixes it. The banner shows that message
instead of hiding itself, with the update button suppressed since updating
cannot work until the cause is fixed. The success path is untouched.
This does not fix the installer, which is the real cause; it stops the symptom
being invisible. The installer needs SUDO_USER handling and a chown, and its
suggestion to run as root should go.
Reverting the endpoint change fails four of the five new tests; the fifth
guards the success path and correctly does not move.
Co-Authored-By: Claude Opus 5 (1M context) <noreply@anthropic.com>
Claude-Session: https://claude.ai/code/session_01STMbQE4YctTacQXfbYqKuW
|
Warning Review limit reached
Next review available in: 9 minutes Limit details: You’ve used the included review currently available. You've used all free OSS reviews for now. Wait for the free limit to reset to keep reviewing this public repository. How can I continue?Wait for the limit to reset, then comment An organization admin can change what happens after included review limits in Billing. How do review limits work?CodeRabbit enforces per-developer PR review limits within each organization. For paid Pro and Pro+ reviews, CodeRabbit uses a developer's included PR review attempts over the past 7 days to set the current hourly allowance. At typical activity levels, the full plan allowance applies. Higher sustained activity can lower the allowance until earlier attempts leave the 7-day window. Please refer docs for additional details. Review details⚙️ Run configurationConfiguration used: Organization UI Review profile: CHILL Plan: Pro Plus Run ID: 📒 Files selected for processing (3)
Thanks for using CodeRabbit! It's free for OSS, and your support helps us grow. If you like it, consider giving us a shout-out. Comment |
Up to standards ✅🟢 Issues
|
|
Superseded by #485, which combines the seven api_v3.py PRs so they do not conflict with each other. Every change from this PR is verified present on that branch; the branch here is untouched if you want to compare. |
Follow-on from #482, same area, different failure. #482 explains checkouts that report an error; this one explains checkouts that report nothing at all.
The silence
check-updatereturnsupdate_available: Falsewhenever git fails:and the banner is the only route to the update button:
So a checkout git refuses to touch looks exactly like a current one, permanently — no banner, no button, no error, just a log line the user will never read.
Why a checkout ends up in that state
scripts/install/one-shot-install.sh:${HOME}/LEDMatrix(line 283, 337)SUDO_USER— zero referenceschownat all — zero occurrencessudo bash -c "$(curl -fsSL ...)"Follow that suggestion and the checkout is root-owned. Tested on real hardware rather than assumed:
Every git command fails, including this endpoint's fetch. Nothing in the codebase handles
safe.directoryor dubious ownership — I checked.What changes
A failed check now reports
check_failedwith a message the user can act on. For dubious ownership that means naming the actual remedy (sudo chown -R ...), because git's own suggestion — adding asafe.directoryexception — would let git read the repo while leaving it owned by root, which is not what anyone wants here.The banner shows that message rather than hiding itself, with the update button suppressed, since updating cannot succeed until the cause is fixed. Offline is distinguished from broken. The success path is untouched.
Scope
This does not fix the installer, which is the actual cause — it stops the symptom being invisible. The installer wants
SUDO_USERhandling and achown, and the suggestion to run it as root should go. That is a separate change to a script I cannot exercise end to end from here, and it is worth doing deliberately rather than bundling.Verification
Five tests driving the endpoint with a mocked failing fetch. Reverting the endpoint change fails four of them; the fifth guards the success path and correctly does not move. 292 tests pass.
Touches a different region of
api_v3.pythan #482, so the two are independent.