Skip to content

fix(qa-deeper): 3 bugs from deeper QA — multi-room subscribe + part output + send-file silent hang - #439

Merged
joelteply merged 1 commit into
canaryfrom
fix/multi-room-and-send-file-and-shared-helper
May 2, 2026
Merged

joelteply merged 1 commit into
canaryfrom
fix/multi-room-and-send-file-and-shared-helper

Conversation

@joelteply

Copy link
Copy Markdown
Contributor

Continuing 'fix till totally reliable' grind. 3 more real bugs from deeper QA on canary 2ca8073:

# Bug Fix
B5 airc join --room NEW blocked by trust-existing-monitor short-circuit Detect new-room intent + bypass short-circuit; subscribe + resolve gist + add mapping
B6 airc part X prints contradictory '✓ deleted' + 'preserving' messages Gate teardown's preserve message on AIRC_TEARDOWN_PART_ONLY != 1
B7 airc send-file PEER hangs silently for gh-only peers Precheck empty host_target; die loud with clear error + alternatives

B5 details

Multi-room workflow was broken. To add a new subscription you had to teardown + rejoin (losing all running state). Now airc join --room NEW on a live scope appends the subscription cleanly; bearer respawn picks it up within ~30s.

B7 details

Post-#281 substrate is gh-only. send-file uses scp+ssh which require local pair-handshake — gh-only peers have no SSH authorization. Pre-fix scp hung 30+s with no output; user saw nothing. Now: clear error explaining the constraint + suggests alternatives.

Verification

  • bash -n clean on all 3 files
  • B7 reproduced + fixed: clear error message instead of silent hang

Pairs with

🤖 Generated with Claude Code

…scribe + part output + send-file silent hang

Self-QA caught 3 more user-facing bugs after #438 landed. All fixable
in one focused PR.

## B5: airc join --room NEWNAME blocked when monitor already running

Pre-fix the trust-existing-monitor short-circuit in cmd_connect (line
253-260) returned 0 unconditionally when the scope's airc.pid showed a
live monitor. Result: user passes `airc join --room qa-test`, gets back
"this scope's monitor is already running" — but qa-test is NOT in
subscribed_channels. To add a new subscription user had to teardown +
rejoin the scope, losing all running state.

Fix: detect when --room was explicit AND the requested name is NOT in
the existing subscribed_channels. In that case, fall through to
subscribe + resolve-or-create the channel gist + save mapping. Bearer
respawn (per _monitor_multi_channel's outer cycle) picks it up within
~30s.

Verified by reading the diff path: subscribe → channel_gist resolve
--create-if-missing → set_channel_gist mapping. The bearer's outer
cycle re-reads channel_map so the next poll subscribes to the new
gist automatically.

## B6: airc part X prints contradictory "deleted" + "preserving" messages

cmd_part deletes room_gist_id (per-channel mapping) and prints
"✓ Room gist deleted." Then cmd_teardown is invoked under
AIRC_TEARDOWN_PART_ONLY=1, sees host_gist_id (a separate file
tracking host-mode marker), and prints "preserving hosted gist
(bus stability)." User reads both and is confused — looks like
the system both deleted AND preserved the same gist.

Fix: gate cmd_teardown's primary "preserving" message on
AIRC_TEARDOWN_PART_ONLY != 1. When part is the caller, it owns the
gist-disposition messaging; teardown stays silent on that.

## B7: airc send-file silent hang on gh-only peers

Post-Phase-3c (#281), substrate is gh-only. send-file uses scp +
relay_ssh which require the peer's host to have authorized our
identity-key via local TCP pair-handshake. For gh-only peers (joined
via gist substrate, never via TCP handshake), there's NO SSH
authorization in authorized_keys. scp hangs on "Permission denied
(publickey)" for 30+ seconds with no useful surface output, then
times out silently — user sees nothing.

Fix: precheck for empty host_target. If empty, the peer was never
pair-handshaked (gh-only path) → die() with a clear, actionable
error explaining the constraint + suggesting alternatives (use
airc msg for messaging, share a link for file transfer until
gh-substrate file transfer is implemented).

The 1MB gist hard limit makes gh-substrate file transfer impractical
for most files — proper fix is a future bearer that can stream large
payloads. For now, fail loud beats hang silent.

## Verification

- `bash -n` clean on all 3 modified files
- B7 verified: `airc send-file other-mac /tmp/payload` now produces
  the clear error message instead of hanging

## Pairs with

- #422 (canary→main — keep clearing real bugs before promote)
- #428 (--health stale-channel scope — same QA-driven cleanup pattern)
- #438 (4 earlier QA bugs)
- #281 (Phase 3c — what removed the SSH transport that send-file
  still expects)

Joel directive 2026-05-02: "fix till totally reliable" + "great work,
keep repairing and qa as you merge". This is the next batch.

🤖 Generated with [Claude Code](https://claude.com/claude-code)

Co-Authored-By: Claude Opus 4.7 (1M context) <[email protected]>
Copilot AI review requested due to automatic review settings May 2, 2026 21:03
@joelteply
joelteply merged commit da0d313 into canary May 2, 2026
9 checks passed
@joelteply
joelteply deleted the fix/multi-room-and-send-file-and-shared-helper branch May 2, 2026 21:04
joelteply added a commit that referenced this pull request May 2, 2026
…g parse (#440)

fix(qa): 2 fresh-install bugs — daemon bootstrap I/O error + 'airc msg @peer text' quoted-arg parse

Found by self-QA on the fresh-install path Joel asked about. Both
hit first-time users + are quick fixes.

## #9: launchctl bootstrap "Input/output error" on macOS daemon install

Pre-fix `airc daemon install` over an existing daemon (e.g., switching
scopes or re-installing after a stale registration) emits:

  Wrote /Users/joelteply/Library/LaunchAgents/com.cambriantech.airc.plist
  Bootstrap failed: 5: Input/output error
  Try re-running the command as root for richer errors.
  ERROR: launchctl bootstrap failed. Plist written but not loaded;
         check Console.app for errors.

Then `die`s. But the plist file IS written + the service IS often
loaded (launchd's "Input/output error 5" is actually "service
already loaded" — bootstrap's stderr lies).

Two real bugs:
1. bootout (line 200) doesn't wait for the previous PID to fully
   exit before bootstrap fires. Result: launchd sees "service still
   loaded" → bootstrap fails.
2. die() on bootstrap stderr alone is wrong — verify by checking
   `launchctl list` for the service. If listed, success regardless
   of stderr noise.

Fix:
- After bootout, poll `launchctl list` for up to 3s (6×500ms) until
  the service disappears.
- Bootstrap with stderr captured (don't die on it).
- Verify by `launchctl list` post-bootstrap. If listed → success.
  If not → die loud with the captured stderr.

This makes daemon install idempotent + reliable across re-installs,
which matters for fresh-install confidence + scope-switching workflow.

## #10: 'airc msg "@peer some text"' rejected as invalid peer name

Pre-fix the strict charset reject in cmd_send.sh:163 fired when the
user quoted the @peer + body together:

  $ airc msg "@continuum-b69f comms check"
  ERROR: Invalid peer name in '@continuum-b69f comms check' —
         must match [a-z0-9-]+ ...

Strict parsing assumed `airc msg @peer "body"` (separate args).
Common UX intuition (and IRC clients like /msg) accept the single-
quoted form as a single line. The reject was correct for safety
but unfriendly.

Fix: pre-process $@ before the parse loop. If $1 starts with @ AND
contains whitespace, split on first whitespace — front becomes the
@-peer arg, back becomes the start of the message body. Then the
existing loop processes them as if they'd been separate args.

Verified: 'airc msg "@peer text"' now passes the @-parse step and
proceeds to send (or hits a downstream init/scope error, which is
fine — proves the parse changed). Original separate-args form
('airc msg @peer "text"') still works.

## Verification

- `bash -n` clean on both modified files
- #10 reproduced + fixed: parse error gone

## Pairs with

- #422 (canary→main — keep clearing first-time-user bugs)
- #439 (deeper-QA fixes — same QA pattern)

🤖 Generated with [Claude Code](https://claude.com/claude-code)

Co-authored-by: Claude Opus 4.7 (1M context) <[email protected]>
@joelteply
joelteply removed the request for review from Copilot May 2, 2026 21:28
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