Repository navigation
Say when a PC needs a bridge update, with the button that does it - #22
Merged
Merged
Conversation
…does it
A PC whose bridge came from another bundle version showed "Reconnecting…"
and retried forever, although only an explicit bridge update could help,
and Update bridge… sat inside the PC's manage panel. The same held for a PC
whose runtime needs setup approval.
Those cases now throw MachineActionRequired: the PC stops retrying, waits
in the error state with action_required ("update_bridge" or "setup"), and
the flag clears once it connects. The sidebar shows the next step under
the PC with its button, and a header line (like the app update notice)
says so even with the drawer closed on a phone.
Co-Authored-By: Claude Opus 5.5 (1M context) <[email protected]>
devswha
pushed a commit
that referenced
this pull request
Oct 6, 2026
…ersion mismatch (#506) ## Change A connect (Add PC) or a reconnect that is refused on the bridge version check used to dead-end in its dialog: the job failed with the raw server text and a **Retry connection** that repeated the same refusal, and because a first connect that fails never registers the PC, no sidebar row appeared to offer the update. The dialog now turns that refusal into the action itself: - `SetupJob` carries an optional `action_required` (`shared/machines.ts`), set in `setup()`'s catch alongside the existing `Machine.action_required`. A PC that was never registered has no machine to carry it, and an interrupted `update_remote` retry keeps offering itself (`job.update` alone). - On `action_required === "update_bridge"` the dialog replaces **Retry connection** with **Update bridge and connect**, which re-runs the setup with `update_remote: true` — through the same approval list a first install shows, so passwords and host keys still work and nothing installs unattended. Approving installs the bundle, restarts the verified bridge and connects; herdr sessions keep running. - An approved replacement accepts a different bridge protocol only for identity verification, preserving authenticated socket, managed ownership and PID checks. The replacement must match the current protocol and bundle version before connecting. Restart waits for the verified old process with a deadline and ignores its stale descriptor. - Both Connect and Update submit the same form: Enter works, required addresses and SSH port limits are enforced, and requesting an update still requires the separate installation approval. - New string `Update bridge and connect` in ko, ja and zh; the hint reuses the sidebar's translated line. This closes the gap left by #22 and #26, which give a registered PC the sidebar/banner button and the background update. Raising `REMOTE_BUNDLE_VERSION` is the moment every reconnecting PC lands exactly here. | Failure offers the update | Approval before install | | --- | --- | |  |  | ## Validation Latest main merged; original contribution by @suho-han is retained and credited in CHANGELOG.md. - Generated-type check, typecheck and production build passed on Bun 1.4.2. - Full unit suite: **1,457 passed, 15 skipped, 0 failed**. - Nine new loopback/fake-SSH regression cases cover first-connect failure, explicit approval, old-protocol replacement, authentication/socket/PID/ownership refusal without stopping a process, and strict verification of the replacement. - Real MachineDialog browser regression passed at **1280px and 390px**: Enter submission, required address, SSH port range, explicit update intent, separate approval and Open PC. Added to browser CI. - Required **Fast checks** and **Integration and browser** passed on `75ee1f304ebf16ffc47beff8aca07417c9dd83e4`. Native Windows installation, all Linux/macOS/Windows bundle checks, real SSH bridge updates and password authentication also passed. All new local tests use disposable state, synthetic endpoints and a fake SSH host; they do not update a real PC or touch a user's herdr session. --------- Co-authored-by: e2e <[email protected]>
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.
Summary
After #21 (remote-v2), every PC connected with a v1 bridge is refused until its bridge is updated. Before this PR, that looked like this:
Now:
MachineActionRequired. The PC stops retrying, waits inerrorwithaction_required: "update_bridge" | "setup", and the flag clears once it connects, or when a reconnect starts.action_requiredisn't persisted.Testing
bun run typecheckpasses,bun testpasses 294/294, andbun run test:uipasses 7/7.remote-v1andremote-v2releases):errorwithaction_required=update_bridge, and it was still inerror4s later, so there's no retry loop.🤖 Generated with Claude Code