- A daemon keeps running the copy it was started from, so after an update the old one ran until the next login and nothing said so; clients compared only the major protocol version. Every build now carries a UUID, the daemon reports it as ServerInfo.build_id under protocol 1.3, and a daemon too old to report one counts as outdated. - The window shows a notice above every page when the daemon it reached is another build, with both versions. Update now registers the copy that was opened as the service and restarts the daemon from it; Not now puts the notice away. Nothing is restarted unless the user asks, so two copies open at once cannot replace each other's daemon in turn. A newer daemon is offered as Use this version, and one the service did not start, or one reached with --socket, gets no button. - service install --start now stops a running daemon before registering and starting, so the daemon started is the program that was asked. Under systemd and Task Scheduler it used to rewrite the registration and leave the old daemon running, since starting a running service does nothing. - service status says when the daemon is another build than the program asked, and --json carries same_build. - The App Store app stops a daemon another build of the app left running and starts its own, instead of attaching to it. - Packaging sets MIDI_HARBOR_BUILD_ID once for everything a run builds, because the App Store app, its helper and each architecture are compiled separately and must agree. Packages of one release share an identifier, so neither replaces the other's daemon.
1.9 KiB
1.9 KiB
Tasks: Daemon Updates
Tasks by their numbers in the project-wide sequence, which continues across every spec. Built and checked in one piece, so not broken into phases.
- T253 Say when the daemon is another build than the window, and update it when the user asks, per FR-B01 to FR-B07, SC-B01, SC-B02 (R-108) — done:
midi_harbor_core::BUILD_IDfromcrates/core/build.rs, one per package run throughMIDI_HARBOR_BUILD_IDinpackaging/macos/build.sh, the Makefile and.goreleaser.yaml;ServerInfo.build_id(7), protocol 1.3; the window shows a notice above every page with Update now and Not now and restarts nothing by itself;ServiceManager::replacestops, registers and starts, andservice install --startuses it;service statussays when the daemon is another build,same_buildin--json; the App Store app stops a daemon another build left and starts its own. Tests: what the notice says and when it offers the button, as a table; the daemon reporting its build over a real socket; and the service lifecycle test now installs with--startover a running daemon and checks the process changed, with the stand-in service managers ignoring a start when running as the real ones do. Checked live on Arch Linux under systemd with two builds given different identifiers: build B'sservice statussaid the daemon was another build; its window showed "The daemon is a different build" with Update now; clicking it rewroteExecStartto build B's path and the journal showed the daemon stopped and started 0.5 s apart, after whichsame_buildwas true and the notice was gone; build A's window opened beside it showed the notice and the daemon kept its start time. Not run: launchd, Task Scheduler and the App Store app's replacement, and the release build with the new environment variable. The view shown while the daemon restarts was not seen, the restart being over before the first screenshot.