Repository navigation
feat(mobile): edit saved host endpoints - #8294
Conversation
|
Note Reviews pausedIt looks like this branch is under active development. To avoid overwhelming you with review comments due to an influx of new commits, CodeRabbit has automatically paused this review. You can configure this behavior by changing the Use the following commands to manage reviews:
Use the checkboxes below for quick actions:
📝 WalkthroughWalkthroughAdds a mobile “Edit host” screen that loads and edits host names and WebSocket endpoints, validates endpoint formats, persists endpoint changes, refreshes host state, and reconnects when needed. Registers the nested edit route and replaces inline renaming with navigation to it. Adds endpoint parsing utilities and tests, plus storage update tests. 🚥 Pre-merge checks | ✅ 3 | ❌ 2❌ Failed checks (2 warnings)
✅ Passed checks (3 passed)
Thanks for using CodeRabbit! It's free for OSS, and your support helps us grow. If you like it, consider giving us a shout-out. Comment |
There was a problem hiding this comment.
Actionable comments posted: 1
ℹ️ Review info
⚙️ Run configuration
Configuration used: Repository UI
Review profile: CHILL
Plan: Pro
Run ID: f7376076-e23e-4f9b-8931-19b01b351aef
📥 Commits
Reviewing files that changed from the base of the PR and between ff8192a and fb91184b2f4a5ffdae99bce8ce08d164d00c65de.
📒 Files selected for processing (7)
mobile/app/h/[hostId]/edit.tsxmobile/app/h/_layout.tsxmobile/app/index.tsxmobile/src/transport/host-endpoint.test.tsmobile/src/transport/host-endpoint.tsmobile/src/transport/host-store-endpoint.test.tsmobile/src/transport/host-store.ts
fb91184 to
bcf0856
Compare
bcf0856 to
2dad7be
Compare
|
@coderabbitai review |
✅ Action performedReview finished.
|
|
@coderabbitai review |
✅ Action performedReview finished.
|
b36e5ff to
20fce37
Compare
There was a problem hiding this comment.
🧹 Nitpick comments (1)
mobile/src/transport/host-endpoint.ts (1)
44-67: 📐 Maintainability & Code Quality | 🔵 Trivial | ⚡ Quick winConsider consolidating the two raw-authority parsers.
extractExplicitPortFromWebsocketUrlandparseRawSchemeAuthorityboth re-implement the same authority-walking steps (bracket detection,@userinfo split, path/query boundary search) to extract different fields (port vs. hostname/flags). They're currently consistent, but the file already had one bug (fixed in a prior review round) stemming from divergent handling between related parsing paths. A singleparseRawSchemeAuthority-style function returning{ hostname, port, hasUserInfo, hasPathOrQuery }would remove this duplication and the risk of the two drifting apart again.Also applies to: 205-230
ℹ️ Review info
⚙️ Run configuration
Configuration used: Repository UI
Review profile: CHILL
Plan: Pro
Run ID: d52e273b-ea62-414b-b23c-34c86deaf5a7
📥 Commits
Reviewing files that changed from the base of the PR and between 91bfdb5 and 20fce37b67c521acacfa718bbf46c7ea74780651.
📒 Files selected for processing (8)
mobile/app/h/[hostId]/edit.tsxmobile/app/h/_layout.tsxmobile/app/index.tsxmobile/src/host-edit-route-accessibility.test.tsmobile/src/transport/host-endpoint.test.tsmobile/src/transport/host-endpoint.tsmobile/src/transport/host-store-endpoint.test.tsmobile/src/transport/host-store.ts
🚧 Files skipped from review as they are similar to previous changes (7)
- mobile/src/transport/host-store-endpoint.test.ts
- mobile/src/host-edit-route-accessibility.test.ts
- mobile/src/transport/host-endpoint.test.ts
- mobile/app/h/_layout.tsx
- mobile/app/h/[hostId]/edit.tsx
- mobile/src/transport/host-store.ts
- mobile/app/index.tsx
20fce37 to
c9080a3
Compare
# Conflicts: # mobile/app/index.tsx
|
reviewing |
…eview-fix pass
…ix) before landing host-endpoint-edit fixes
Two independent review rounds found the same class of foot-gun: a superseded mutator (updateHostEndpoint, then renameHost) left in host-store.ts after the atomic updateHostNameAndEndpoint refactor, with zero remaining callers. Either could be reintroduced by a future caller and silently regress the non-atomic name/endpoint race the atomic function was written to close, so both are removed. Also covers reconnect-rejection and endpoint-only save paths that were missing test coverage, and merges origin/main (stablyai#8789) so this lands without reverting the mobile terminal restore fix. Co-authored-by: Orca <[email protected]>
|
Ran 3 rounds of independent automated review + fix passes on this branch (each round spawned a fresh Claude instance to review the full diff, with every claimed fix independently re-verified against the diff/tests before being trusted):
Pushed the fixes directly to this PR's branch (fast-forward, no history rewrite). Approving and re-triggering CI now. |
AmethystLiang
left a comment
There was a problem hiding this comment.
Approving after 3 rounds of automated review + fix passes (see comment above for details) — all issues found were fixed, final pass came back clean.
Mobile emulator QA — edit saved host endpointsVerdict: PASSED (iOS Simulator) Environment
What was exercised
Results
Persistence (AsyncStorage
|
| Host ID | Name | Endpoint |
|---|---|---|
host-1783828857040 |
Host 1 | ws://192.168.1.23:53307 |
host-1783829804664 |
Host 2 | ws://192.168.1.23:58383 |
host-1783829989178 |
Host 3 | ws://192.168.1.23:60204 |
host-1783842112389 |
Host 4 QA | ws://192.168.1.23:6768 |
Before save: name Host 4, endpoint ws://192.168.1.23:61242.
Supporting unit tests
✓ host-endpoint.test.ts (32)
✓ host-edit-route-accessibility.test.ts (1)
✓ host-edit-save-flow.test.ts (10)
✓ host-store-endpoint.test.ts (5)
Test Files 4 passed
Tests 48 passed
Screenshot evidence
1 · App loaded
Notification opt-in — confirms Orca Mobile dev client (not Expo launcher / redbox).
2 · Host list
Saved desktops after dismissing opt-in.
3 · Action sheet
Long-press Host 4 → Connect / Disconnect / Edit host / Remove.
4 · Edit form
Labeled Name / Address fields, help text, live endpoint preview. Save disabled until dirty.
5 · Rename
Name set to Host 4 QA — Save enabled.
6 · Validation
Address 12345 → “Not a valid hostname.” Save disabled.
7 · Ready to save
Valid address 192.168.1.23:6768 with preview and enabled Save.
8 · After save
Home list shows Host 4 QA · Connecting… (reconnect after endpoint change).
Checklist
- Platform recorded (iOS Simulator, iPhone 17 Pro)
- Emulator helper running
- Metro from
mobile/ - Dev-client URL opened
- App loaded (not Expo launcher / redbox)
- Changed mobile path exercised (edit form + save)
- Post-action screenshot with host-list context
- Paired hosts available (pre-existing; pairing secrets not logged)
- Android parity (skipped)
Notes
- Live desktop connectivity after save was not required for this feature’s core claim (edit + persist name/endpoint without re-pairing). Existing paired hosts pointed at stale LAN ports, so status correctly remained Connecting / Can’t connect.
- Minor cosmetic: floating settings gear slightly overlaps Save on the edit screen; Save still worked via the accessibility target.
Verdict
QA PASSED — Edit saved host endpoints is functional on iOS Simulator: entry from the host action sheet, labeled form, validation, atomic save of name + endpoint, and reconnect attempt after save all behaved as intended. Supporting unit tests (48/48) also passed.
Generated via orca-mobile-emulator-qa · 2026-07-14
- Trims the redundant comment explaining the savingRef race guard down to one line. - Changes the "no longer saved" load-error copy to "was removed" for clearer phrasing, updating the matching test expectation.
* feat(mobile): edit saved host endpoints * fix(mobile): reject ambiguous numeric host addresses * fix(mobile): label edit host inputs * fix(mobile): make host edit save atomic and remove superseded mutators Two independent review rounds found the same class of foot-gun: a superseded mutator (updateHostEndpoint, then renameHost) left in host-store.ts after the atomic updateHostNameAndEndpoint refactor, with zero remaining callers. Either could be reintroduced by a future caller and silently regress the non-atomic name/endpoint race the atomic function was written to close, so both are removed. Also covers reconnect-rejection and endpoint-only save paths that were missing test coverage, and merges origin/main (stablyai#8789) so this lands without reverting the mobile terminal restore fix. Co-authored-by: Orca <[email protected]> * Simplify save-race comment and reword host-removed error message - Trims the redundant comment explaining the savingRef race guard down to one line. - Changes the "no longer saved" load-error copy to "was removed" for clearer phrasing, updating the matching test expectation. --------- Co-authored-by: Jinjing <[email protected]> Co-authored-by: Orca <[email protected]>








Summary
This is the host-endpoint replacement extracted from #7949. It intentionally excludes device identity and iOS scene-lifecycle work.
Refs #7949
Screenshots
No screenshot attached. The change adds an edit affordance and reuses the existing mobile form primitives; no desktop UI changes.
Testing
oxlintoxfmt --checkpnpm check:max-lines-ratchetgit diff --check origin/main...HEAD::AI Review Report
Independent review ended spec PASS / quality APPROVED. It checked explicit default ports, IPv6 bracket handling, URL/userinfo/path rejection, endpoint-change reconnect behavior, and preservation of pairing credentials.
A final gate found that the first validator accepted malformed IPv6 with multiple compression markers; the fix now reuses the standard URL parser for bracketed IPv6 and has focused regression coverage.
Security Audit
Compatibility
The endpoint normalizer preserves ws/wss and IPv4/IPv6 forms used by the existing transport. No desktop, SSH command, keyboard, filesystem, or Git-provider behavior changes.
Notes
Validation used Node 26.5.0 while the repository declares Node 24; checks passed with the expected engine warning.