Skip to content

fix: verify reads only the CLI's stdout as the status document - #12

Merged
jeremy-robotsson merged 2 commits into
mainfrom
fix/verify-stderr
Oct 23, 2026
Merged

jeremy-robotsson merged 2 commits into
mainfrom
fix/verify-stderr

Conversation

@jeremy-robotsson

@jeremy-robotsson jeremy-robotsson commented Oct 23, 2026 •

Copy link
Copy Markdown
Member

What

Verify passed the CLI's stderr to jq together with the status --probe --json document. It now reads only stdout as the document, and shows stderr only when the command fails.

Why

From Varlatch 0.19.0, the CLI prints a one-line warning on stderr when it runs on a Node.js release without its line's security fixes (varlatch/varlatch#62, CVE-2026-111497). With that line first, jq fails to parse. Because bin/varlatch-menu runs under set -euo pipefail, the action then exits without any notification: clicking Verify does nothing.

The widget itself already reads stdout and stderr separately (BarWidget.qml). In bin/varlatch-menu, the other places that merge stderr only show it as text: status-notify, failed logout, the login log and --help. There, the warning just shows up as an extra line.

Tests

tests/run.sh has a new verify section, and tests/fake-varlatch gains FAKE_STDERR (a line written to stderr on every call) and FAKE_STATUS_FAIL. The tests cover:

  • the probe state of each server in the notification;
  • the same with the Node.js warning on stderr. This test fails on main with jq: parse error;
  • on failure, the notification carries what the CLI said on stderr;
  • no temporary file is left after success, failure, or SIGTERM during the probe (review round 1). That last case fails on 7f24099: an EXIT trap now removes the file, and HUP/INT/TERM become exits so it runs.

All 82 tests pass locally. shellcheck is not installed on this machine, so CI runs it.

No CHANGELOG entry: entries are written at release time here.

🤖 Generated with Claude Code

`verify` merged stderr into the `status --probe --json` output it hands
to jq. Varlatch 0.19.0's CLI warns on stderr when it runs on a Node.js
release without its line's security fixes (varlatch/varlatch#62); with
that line first, jq fails, and under `set -euo pipefail` the action
exits without a notification. stderr now goes to a temporary file and is
shown only when the command fails.

Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
Review round 1: a SIGTERM during the probe left the temporary file
behind. An EXIT trap now removes it, and HUP, INT and TERM become exits
so that trap runs (bash skips it when a signal kills the shell).

Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
@jeremy-robotsson
jeremy-robotsson marked this pull request as ready for review October 23, 2026 13:33
@jeremy-robotsson
jeremy-robotsson merged commit a5dd7ea into main Oct 23, 2026
1 check passed
@jeremy-robotsson
jeremy-robotsson deleted the fix/verify-stderr branch October 23, 2026 13:33
@jeremy-robotsson jeremy-robotsson mentioned this pull request Oct 24, 2026
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