Repository navigation
feat(flatpak): a new window replaces a notesd of an older build (plan 0008, G3) - #106
Merged
Merged
Conversation
An update replaces the running notesd: rpc.shutdown (local callers) answers and then stops notesd as SIGTERM does; rpc.hello names the Flatpak build (app-commit of .flatpak-info); notesd -build prints it; notesctl hello --build and notesctl shutdown (bounded, waits for the socket to go silent and the data lock to free).
…(G3) The launcher compares notesctl hello --build with notesd -build run through flatpak-spawn --latest-version, stops a notesd of another build with notesctl shutdown, and starts the latest. Every wait is bounded. The smoke test covers the replacement, a kept notesd of the latest build and an unknown latest build.
Design (the Flatpak: updates), specs (rpc.shutdown, hello's build) and plan 0008's G3 status. Test that a write repeated after a lost answer changes nothing.
…oss-review) A command substitution waits for EOF on its pipe, and flatpak-spawn hands the pipe to the portal and the new sandbox, which the timeout does not kill. The query now writes to a temporary file in the state directory. The smoke test adds a query that leaves a detached process on its output.
… not absent (cross-review)
…links lodge-app.md (cross-review)
…itten its PID (cross-review)
Contributor
Author
|
Cross-review: reviewer |
bketelsen
approved these changes
Oct 28, 2026
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.
Plan 0008, gap G3: after
flatpak update, the notesd that runs stays at the old build until logout, and new windows use it. This PR makes a new window replace it, only forward. Design: ADR-0032 (Proposed), after frostmail ADR-0046 and frostmail#126, which built the same for maild.What changes
schema/rpc/rpc.yaml, additive in protocol 1):rpc.hellogains an optionalbuild(theapp-commitof[Instance]in/.flatpak-info); newrpc.shutdown, callerslocalonly (lodge's callers getmethodNotFound).-buildprints the instance's build;rpc.shutdownanswers, then stops notesd as SIGTERM does (requests in hand are cancelled and awaited; sync, vaults, store and lock stop in order; exit 0).hello --build;shutdown(one 30 s deadline; returns when the socket is silent and the data directory's lock is free).packaging/flatpak/frostnotes.sh): every wait is bounded (timeout); when a notesd answers, it comparesnotesctl hello --buildwithflatpak-spawn --latest-version notesd -build, runsnotesctl shutdownwhen they differ, and starts notesd withflatpak-spawn --latest-version. The portal-failure message is unchanged (G5 reads it).design/app.md(The Flatpak, "Updates"),specs/rpc-protocol.md,specs/lodge-app.md, plan 0008 G3 status, the index.No write is lost
A write cut by the stop is whole or absent (atomic file write, one transaction; a file that reached the disk is indexed by the next scan). The app keeps unsaved text, reconnects and saves again on the same base; a new test in
internal/vault/write_test.goshows that a repeated write on the same base merges with no conflict.Limits
rpc.shutdown); later updates use it.Checks
make checkpasses (under umask 022;TestFileRefusesReadableFilefails under umask 077 on a cleanmaintoo).go test -raceoncmd,rpcserver,vault;sh -nand shellcheck 0.11.0 on both scripts; the smoke test passed on the host with builtnotesdandnotesctl.ADR-0032 is Proposed: merging this PR accepts it, or Brian says otherwise.