Skip to content

Updater: refresh the Store after outside changes; deploy: refuse removing a required component - #341

Merged
robertnisipeanu merged 2 commits into
mainfrom
refresh-updater-state
Nov 19, 2026
Merged

robertnisipeanu merged 2 commits into
mainfrom
refresh-updater-state

Conversation

@robertnisipeanu

Copy link
Copy Markdown
Owner

The Store learns what is installed only from the state the updater sends, so a component installed or removed outside the updater (the deploy tool run on the command line) stayed on screen as before until the Store connected again. The deploy tool's uninstall also removed a tool that an installed app still required, which the updater itself refuses.

mgu-updater

  • Every 5 seconds it reads the installed tools (/var/opt/<id>/current/component.json) and apps (MainApp's registry and each app's package.json). When that set differs from the last read and the updater is not busy with its own change, it asks the deploy tool for its status again and sends the state to connected clients. The check only reads files and writes nothing.
  • After refusing an install, update, removal or setup request, it sends the state again, so a client with an out-of-date view catches up.

mgu-deploy

  • uninstall <id> refuses while an installed component still depends on it, and names those components. A component depends on a tool when it requires it (from its component.json or the requirements the updater recorded at its install) or needs a capability only that tool provides. An app queued for removal at the next start does not count, and a reinstall (keepPackages) is not checked.
  • remove-all orders tools by the same rule, so dependents go first.

AI: Claude Code, Claude Opus 5.5

Tested:

  • Updater suite (native/mgu-updater/test/test_updater.js, Node 8.16.2): 646 passed. A new check confirms that a tool removed outside the updater, and a refused Remove, each push the state to a connected client.
  • Deploy suite (deploy/test/run.sh): all passed. The new testUninstallRequired confirms that a tool required by an installed app is refused and is removed once the app is gone. The remove-all tests pass with the new order.
  • Test unit, iDrive 7, with this branch's updater and deploy tool:
    • With Live Data installed (which requires the controller gate), mgu-deploy.sh uninstall mgu-inputgate --yes was refused with "mgu-inputgate is required by live_data; uninstall it first" (exit 2), and the gate stayed installed.
    • After Live Data was removed, the same command removed the gate. A client connected to the updater's socket, sending no requests, received a state showing the gate not installed about 7 seconds later.
  • Not tested: the Store page itself on screen (it gets the same state message), and iDrive 8.

Human review: no

Screenshots: n/a

🤖 Generated with Claude Code

robertnisipeanu and others added 2 commits November 19, 2026 13:42
…omponent

The updater sends its state again when the installed tools and apps change
outside its own actions, and after it refuses an install, update or
removal. The deploy tool's uninstall refuses a component that an installed
app or tool still depends on, and remove-all removes dependents first.

Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
@robertnisipeanu
robertnisipeanu merged commit e6ae535 into main Nov 19, 2026
1 check passed
@robertnisipeanu
robertnisipeanu deleted the refresh-updater-state branch November 19, 2026 11:57
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