Skip to content

fix(terminal): send a secret entered before the reconnect's snapshot arrived - #244

Merged
devswha merged 3 commits into
mainfrom
fix/secret-input-flake
Oct 1, 2026
Merged

devswha merged 3 commits into
mainfrom
fix/secret-input-flake

Conversation

@devswha

@devswha devswha commented Oct 1, 2026

Copy link
Copy Markdown
Owner

Closes #242.

Cause

After a reconnect the client clears what it knows about the server's features and learns them again from the snapshot frame. The terminal's output can arrive first, and the masked input shows as soon as output is on screen. A Send in that gap made sendSecret answer "unsupported" locally and send nothing, so the password field stayed with an error.

submit already waits for the snapshot (up to 2 s) before it decides; sendSecret did not. It became visible on 2026-10-01 after the snapshot got slower: it now asks herdr for the foreground process of every shell pane (#224).

Fix

sendSecret waits for the connection's snapshot the same way, then sends or answers unsupported.

Evidence

  • scripts/secret-input-regression.ts alone, 25 runs with frame logging: 5 failures before, each with the snapshot arriving after the first output and no secret frame sent; 0 failures in 25 runs after.
  • src/lib/ws.test.ts (new, a fake WebSocket): a secret entered before the snapshot is sent once the snapshot lists masked input; it fails with the old sendSecret. A snapshot without the feature still answers unsupported and sends nothing.
  • bun run typecheck; bun run test:unit 656 pass.

@coderabbitai

coderabbitai Bot commented Oct 1, 2026

Copy link
Copy Markdown

Review in Change Stack →

Navigate logical layers of code changes, visualize relationships, and explore their blast radius.

Note

Currently processing new changes in this PR. This may take a few minutes, please wait...

⚙️ Run configuration

Configuration used: Repository: devswha/herdr-web-ui/.coderabbit.yaml

Review profile: CHILL

Plan: Advanced

Run ID: b0acec15-e04d-4b9e-bcf4-ad6c10d36293

📥 Commits

Reviewing files that changed from the base of the PR and between f8a74c4 and d68c4f7.

📒 Files selected for processing (3)
  • CHANGELOG.md
  • src/lib/ws.test.ts
  • src/lib/ws.ts
 ________________________________________________________
< Your error handling is basically thoughts and prayers. >
 --------------------------------------------------------
  \
   \   (\__/)
       (•ㅅ•)
       /   づ
✨ Finishing Touches
📝 Generate docstrings
  • Commit to this branch
  • Create a new PR
🧪 Generate unit tests (beta)
  • Commit to this branch
  • Create a new PR
  • Autopilot · Keep fixing CodeRabbit findings and required CI, and resolving merge conflicts

Autopilot is currently an internal CodeRabbit preview.


Comment @coderabbitai help to get the list of available commands.

@devswha
devswha merged commit 3591a04 into main Oct 1, 2026
2 of 5 checks passed
@devswha
devswha deleted the fix/secret-input-flake branch October 1, 2026 08:38
devswha added a commit that referenced this pull request Oct 1, 2026
Release v0.3.39: moves the Unreleased notes under 0.3.39 and bumps
`package.json` and `herdr-plugin.toml`.

In this release, all fixes: a password sent right after a reconnect
(#244), typing and keys outliving their connection (#235), panning a
terminal whose grid is not the browser's own on a phone (#241), omo's
question form in the chat (#237 by @nahwan-kim), and a held pane resumed
by a late herdr answer plus a new shell taken for OmO (#243). No remote
bundle change: `REMOTE_BUNDLE_VERSION` stays 9.

Changelog housekeeping that was waiting for a release:
- Compare links at the bottom now cover 0.3.31 to 0.3.39 (they stopped
at 0.3.30), and `[Unreleased]` compares from v0.3.39.
- Five references that were a bare `#N` are full PR links with their
author: #164 is the issue PR #199 fixed, #154 the issue PR #155 closed,
and #45 and #6 are PRs. No other wording of released entries changed.

`bun scripts/release-notes.ts 0.3.39` prints the notes and exits 0.
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.

Flaky: the secret-input browser check times out waiting for the password field to go away

1 participant