Skip to content

fix(web): ask for the restart that makes an update take effect - #484

Closed
ChuckBuilds wants to merge 1 commit into
mainfrom
fix/update-prompts-restart
Closed

fix(web): ask for the restart that makes an update take effect#484
ChuckBuilds wants to merge 1 commit into
mainfrom
fix/update-prompts-restart

Conversation

@ChuckBuilds

Copy link
Copy Markdown
Owner

Third in the update-path series (#482, #483). Those cover checkouts that cannot pull. This one covers a pull that succeeds and still changes nothing the user can see.

The update button restarts nothing

The git_pull handler is 172 lines and contains zero occurrences of systemctl, restart, reload, reboot or service:

git_pull handler: lines 1933-2104 (172 lines)
  'restart': 0 occurrence(s)
  'systemctl': 0 occurrence(s)
  'reload': 0 occurrence(s)
  'reboot': 0 occurrence(s)
  'service': 0 occurrence(s)

It stashes, pulls, installs changed requirements, re-removes plugins the user had uninstalled — and returns "Code updated successfully."

Both services go on running the code they loaded at boot. The display keeps rendering the old build; the web interface keeps serving the old build. The user is told the update worked, sees no change, and the next reboot is what actually applies it — whenever that happens to be.

The affordance already exists

The restart-pending banner is raised after main-config saves ("Configuration saved — restart the display to apply the changes") with a Restart Now button already wired to restart_display_service. A code update is a stronger reason to show it than a config save is, and it was the one path that never did.

What changed

  • The response reports restart_required, and applyUpdate raises the banner with wording for a code update.
  • The banner's message became a parameter, persisted next to the existing flag in sessionStorage — it outlives the page that raised it, so the text has to survive a reload too.
  • restart_required is true only when the pull actually moved HEAD. "Already up to date" is a success as well, and prompting after a no-op would train users to dismiss the prompt unread.

Scope

This covers the display service — what the Restart Now button drives, and what users actually notice. The web interface still picks up its own new code on its next restart. Restarting it from inside a request it is currently serving is a bigger change with real failure modes, and it belongs in its own PR rather than smuggled into this one.

Verification

Three tests driving the endpoint with git mocked: HEAD moved → asks for a restart; already-up-to-date → does not; failed pull → does not. Reverting the flag fails the first. 290 tests pass.

Touches a different region of api_v3.py than #482 (resolve_pull_command) and #483 (check_for_update), so all three are independent.

The update button pulls new code and restarts nothing. There is no systemctl,
restart, reload or reboot anywhere in the 172-line git_pull handler -- it
stashes, pulls, installs changed requirements, re-removes plugins the user had
uninstalled, and returns "Code updated successfully."

Meanwhile both services go on running the code they loaded at boot. So the
display keeps rendering the old build, the web interface keeps serving the old
build, and the user is told the update worked. Nothing on screen suggests
otherwise, and the next reboot is what actually applies it -- whenever that is.

The affordance for this already exists: the restart-pending banner, raised
after main-config saves, with a Restart Now button wired to the display
service. A code update is a stronger reason to show it than a config save is.

The response now reports restart_required, and applyUpdate raises the banner
with wording for a code update rather than a config save. The banner's message
became a parameter and is persisted next to the flag, since it outlives the
page that raised it.

restart_required is only true when the pull actually moved HEAD. "Already up
to date" is a success too, and prompting after a no-op would train users to
dismiss the prompt unread.

This covers the display service, which is what the Restart Now button drives
and what users notice. The web interface still picks up its own new code on
its next restart; restarting it from inside a request it is serving is a
larger change than this one.

Reverting the flag fails the test that a pull which moved HEAD asks for a
restart. 290 tests pass.

Co-Authored-By: Claude Opus 5 (1M context) <noreply@anthropic.com>
Claude-Session: https://claude.ai/code/session_01STMbQE4YctTacQXfbYqKuW
@coderabbitai

coderabbitai Bot commented Aug 20, 2026

Copy link
Copy Markdown

Warning

Review limit reached

@ChuckBuilds, you've reached your PR review limit, so we couldn't start this review.

Next review available in: 23 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 @coderabbitai review or push new commits to the PR.

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 configuration

Configuration used: Organization UI

Review profile: CHILL

Plan: Pro Plus

Run ID: 4acbabc7-bf03-4962-8b35-e6d3e4526728

📥 Commits

Reviewing files that changed from the base of the PR and between cf0a551 and 6642a78.

📒 Files selected for processing (4)
  • test/test_update_prompts_restart.py
  • web_interface/blueprints/api_v3.py
  • web_interface/static/v3/app.js
  • web_interface/templates/v3/base.html

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.

❤️ Share

Comment @coderabbitai help to get the list of available commands.

@codacy-production

Copy link
Copy Markdown

Up to standards ✅

🟢 Issues 0 issues

Results:
0 new issues

View in Codacy

🟢 Metrics 7 complexity · 0 duplication

Metric Results
Complexity 7
Duplication 0

View in Codacy

NEW Get contextual insights on your PRs based on Codacy's metrics, along with PR and Jira context, without leaving GitHub. Enable AI reviewer
TIP This summary will be updated as you push new changes.

@ChuckBuilds

Copy link
Copy Markdown
Owner Author

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.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

1 participant