Skip to content

fix(flatpak): default keyring, withdrawn pairings, launcher lifetime and logs - #98

Merged
bketelsen merged 4 commits into
mainfrom
flatpak/snow-test-fixes
Oct 26, 2026
Merged

bketelsen merged 4 commits into
mainfrom
flatpak/snow-test-fixes

Conversation

@frostyard-machines

Copy link
Copy Markdown
Contributor

Fixes from Duncan's test of the Flatpak (#97, CI run 40389390295) on a real Snow install in an incus VM, 2026-10-26. All 6 ADR-0031 items passed there; this PR fixes the 2 defects and 2 notes the test found, and records the evidence in ADR-0031 (still Proposed, for Brian to accept).

A. Hub join without a login keyring. secrets: set hub/<id>/token: Object does not exist at path "/org/freedesktop/secrets/collection/login".

  • internal/secrets: Set reads the default alias (ReadAlias); with none, or with a stale path, it calls CreateCollection with the alias default ("Default keyring"), as libsecret does, and retries once. ErrNoKeyring names FROSTNOTES_SECRETS=file.
  • internal/syncer: sync.pair writes and deletes a probe secret before it contacts the hub, so the keyring's prompt comes first and a store that cannot keep a token fails without a pairing.
  • New hub endpoint DELETE /sync/device (device token, not through authenticated, which would mark it seen): the hub deletes a device that never made a request (204), else 409. sync.paired withdraws after any failure once the token is handed out (sameHub, Secrets.Set, PutSyncHub). Lodge forwards any method on device routes (checked in lodge's gateway/kinds.go).

B. The window's sandbox stays alive. The launcher ends flatpak-spawn with SIGKILL once notesctl hello answers (it forwards catchable signals to notesd; without --watch-bus the portal keeps notesd).

C. Autostart logs to the journal. frostnotes --background appends to $XDG_STATE_HOME/frostnotes/notesd.log, keeping one old log over 1 MiB.

D. /home paths on Snow. vaultPath reads /home/... as /var/home/... when /home is missing and /var/home exists.

Specs: sync-protocol.md (endpoint, pairing rules), lodge-app.md. Design: app.md (the Flatpak), sync.md (pairing).

Checks: make check passes; go test -race on secrets, hub, syncer, store, engine passes; the smoke test (now through the launcher with a stand-in flatpak-spawn, checking it ends and the log turns over) passes on the host; shellcheck clean. The real portal paths need a re-run of items 3 and 4 on the Snow VM; asked through Odrade.

Coder: deepseek/deepseek-flash (code, tests, specs); Irulan (docs, review).

…and logs

Fixes from the Flatpak's test on a real Snow install (2026-10-26):

- secrets: read the default alias and make the default collection when
  the session has none, as libsecret does; retry once on a stale path.
- syncer, hub: probe the secret store before pairing, and withdraw a
  pairing the device cannot keep (DELETE /sync/device); the hub deletes
  a device that never made a request.
- launcher: end flatpak-spawn once notesd answers, so the window's
  sandbox can exit; --background logs to notesd.log with one old log.
- engine: read a vault path under /home as /var/home when only that
  exists (the sandbox on Snow).
- ADR-0031: the test evidence and the fixes.
…no live log

From the cross-review of #98: a failed pairing puts back the token the
store held, under a lock with the hub check and the row, and a second
frostnotes --background no longer moves a running notesd's log.
…ast a cancelled call

From re-review 1 of #98: notesd -log rotates and opens its log only once
it holds the data directory's lock, so no launcher can move a live log;
restore puts the old token back with a context of its own.
…closes

From the Snow retest (T269): godbus closes the signal channel with the
connection, and the wait read a nil signal and panicked; a service that
crashed during a prompt held sync for ever. The wait now ends with
ErrUnavailable on either. ErrDismissed names any prompt, not only an
unlock. ADR-0031: the retest's evidence, the locked Default keyring at
each login, and this fix.
@frostyard-machines frostyard-machines added the ready-for-human Reviewed, CI green: ready for Brian to review and merge label Oct 26, 2026
@bketelsen
bketelsen merged commit e850667 into main Oct 26, 2026
8 checks passed
@bketelsen
bketelsen deleted the flatpak/snow-test-fixes branch October 26, 2026 23:00
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

ready-for-human Reviewed, CI green: ready for Brian to review and merge

Projects

None yet

Development

Successfully merging this pull request may close these issues.

2 participants