Repository navigation
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:
📝 WalkthroughWalkthroughThis PR adds a mobile edit-host screen with endpoint normalization and saved-host updates, replacing the in-place rename modal with navigation to the new screen. It adds mobile device display-name helpers, sends the device name in the E2EE auth handshake, stores the reported name on the channel, and updates the runtime device registry name on handshake completion. It also introduces an Expo iOS config plugin that rewrites the native app lifecycle to use a SceneDelegate-based setup and registers that plugin in Expo config. 🚥 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: 3
🧹 Nitpick comments (3)
mobile/src/transport/host-endpoint.test.ts (1)
4-14: 📐 Maintainability & Code Quality | 🔵 Trivial | ⚡ Quick winAdd a test for
displayHostEndpointwith an IPv6 URL.The existing suite doesn't cover IPv6 display. A test would have caught the bracket-loss bug described above.
✅ Suggested test addition
it('shows host:port for websocket URLs', () => { expect(displayHostEndpoint('ws://192.168.1.10:6768')).toBe('192.168.1.10:6768') // Why: URL omits default scheme ports (443 for wss); use a non-default port. expect(displayHostEndpoint('wss://desk.example:8443')).toBe('desk.example:8443') }) + + it('wraps IPv6 hostname in brackets', () => { + expect(displayHostEndpoint('ws://[fd7a:115c:a1e0::1]:6768')).toBe( + '[fd7a:115c:a1e0::1]:6768' + ) + })mobile/src/transport/host-store-endpoint.test.ts (1)
30-57: 📐 Maintainability & Code Quality | 🔵 Trivial | 💤 Low valueConsider adding a multi-host preservation test.
The current test only has one host in storage. A test with two hosts would verify that
updateHostEndpointmodifies only the matching host and leaves others untouched.mobile/app/h/[hostId]/edit.tsx (1)
73-76: 📐 Maintainability & Code Quality | 🔵 Trivial | 💤 Low valueStore full
NormalizeHostEndpointResultin the memo to avoid double normalization.
normalizeHostEndpointis called again in the render IIFE at line 245 to retrieve the error message. Storing the full result eliminates the redundant call and simplifies the preview/error rendering.♻️ Proposed refactor
const normalizedPreview = useMemo(() => { - const result = normalizeHostEndpoint(address, { fallbackPort }) - return result.ok ? result.endpoint : null - }, [address, fallbackPort]) + return normalizeHostEndpoint(address, { fallbackPort }) + }, [address, fallbackPort])Update
canSaveand rendering to use.ok/.endpoint/.errordirectly:const nameChanged = host != null && nameTrimmed.length > 0 && nameTrimmed !== host.name const endpointChanged = - host != null && normalizedPreview != null && normalizedPreview !== host.endpoint + host != null && normalizedPreview.ok && normalizedPreview.endpoint !== host.endpoint const canSave = host != null && nameTrimmed.length > 0 && - normalizedPreview != null && + normalizedPreview.ok && (nameChanged || endpointChanged) && !saving- {normalizedPreview ? ( + {normalizedPreview.ok ? ( <Text style={styles.preview} numberOfLines={2}> - Connects to {normalizedPreview} + Connects to {normalizedPreview.endpoint} </Text> ) : address.trim().length > 0 ? ( <Text style={styles.previewError}> - {(() => { - const result = normalizeHostEndpoint(address, { fallbackPort }) - return result.ok ? null : result.error - })()} + {normalizedPreview.error} </Text> ) : null}
ℹ️ Review info
⚙️ Run configuration
Configuration used: Repository UI
Review profile: CHILL
Plan: Pro
Run ID: ebda01e4-956b-461d-a201-42b000e0ace6
📥 Commits
Reviewing files that changed from the base of the PR and between 8adfef4 and 38464006e429883a2a83e009f26f41644370352f.
📒 Files selected for processing (17)
mobile/app.jsonmobile/app/h/[hostId]/edit.tsxmobile/app/h/_layout.tsxmobile/app/index.tsxmobile/plugins/ios-uikit-scene-lifecycle.jsmobile/src/transport/device-identity.test.tsmobile/src/transport/device-identity.tsmobile/src/transport/host-endpoint.test.tsmobile/src/transport/host-endpoint.tsmobile/src/transport/host-store-endpoint.test.tsmobile/src/transport/host-store.tsmobile/src/transport/rpc-client.tssrc/main/runtime/device-registry-name.test.tssrc/main/runtime/device-registry.tssrc/main/runtime/rpc/e2ee-channel.test.tssrc/main/runtime/rpc/e2ee-channel.tssrc/main/runtime/runtime-rpc.ts
e38eaa4 to
e4a608e
Compare
There was a problem hiding this comment.
Actionable comments posted: 2
ℹ️ Review info
⚙️ Run configuration
Configuration used: Repository UI
Review profile: CHILL
Plan: Pro
Run ID: 90a6fa13-426f-49a7-aa9c-ec2f1115932f
📥 Commits
Reviewing files that changed from the base of the PR and between e38eaa41b335a485642b057c7aba5847e6ce3bc0 and e4a608ed23bd39f8998ec37af4289e363f716dd9.
⛔ Files ignored due to path filters (1)
mobile/pnpm-lock.yamlis excluded by!**/pnpm-lock.yaml
📒 Files selected for processing (18)
mobile/app.jsonmobile/app/h/[hostId]/edit.tsxmobile/app/h/_layout.tsxmobile/app/index.tsxmobile/package.jsonmobile/plugins/ios-uikit-scene-lifecycle.jsmobile/src/transport/device-identity.test.tsmobile/src/transport/device-identity.tsmobile/src/transport/host-endpoint.test.tsmobile/src/transport/host-endpoint.tsmobile/src/transport/host-store-endpoint.test.tsmobile/src/transport/host-store.tsmobile/src/transport/rpc-client.tssrc/main/runtime/device-registry-name.test.tssrc/main/runtime/device-registry.tssrc/main/runtime/rpc/e2ee-channel.test.tssrc/main/runtime/rpc/e2ee-channel.tssrc/main/runtime/runtime-rpc.ts
🚧 Files skipped from review as they are similar to previous changes (16)
- mobile/app.json
- mobile/src/transport/device-identity.ts
- mobile/package.json
- mobile/src/transport/host-store-endpoint.test.ts
- src/main/runtime/rpc/e2ee-channel.test.ts
- mobile/src/transport/rpc-client.ts
- src/main/runtime/runtime-rpc.ts
- mobile/src/transport/host-store.ts
- src/main/runtime/device-registry.ts
- mobile/src/transport/device-identity.test.ts
- src/main/runtime/device-registry-name.test.ts
- mobile/app/h/_layout.tsx
- src/main/runtime/rpc/e2ee-channel.ts
- mobile/app/h/[hostId]/edit.tsx
- mobile/src/transport/host-endpoint.test.ts
- mobile/app/index.tsx
Add an Edit host screen so paired desktops can change name and connection endpoint without re-pairing (LAN vs Tailscale IP switches). Report the phone marketing model during e2ee_auth so desktop Paired Devices shows e.g. "iPhone 15 Pro Max" instead of "Mobile <date>". Also adopt the iOS 27 UIScene lifecycle via an Expo config plugin so local/TestFlight builds no longer SIGTRAP at launch under Xcode 27 SDK.
- Guard SceneDelegate launchOptions injection and fail if bootstrap rewrite misses - Use expo-device modelName for iOS marketing names (SDK 55) - Preserve IPv6 brackets and original ws/wss scheme on host endpoint edit
- Add expo-device to mobile pnpm-lock.yaml so frozen install succeeds - Reject illegal bare hosts (path/query/spaces) before persistence - SceneDelegate merges cold urlContexts and forwards warm openURLContexts so orca://pair deep links are not dropped under UIScene lifecycle
- Short-circuit AppDelegate rewrites on the bootstrap marker and fail if configurationForConnecting cannot be inserted after a partial pass - Preserve explicit ws :80 / wss :443 that URL.port hides from callers
1ca62d4 to
1487fc9
Compare
|
Superseded by three focused, rebased PRs:
Each replacement targets current Closing this conflicting umbrella PR to avoid duplicate review and merge work. |
Summary
iPhone 15 Pro Max) duringe2ee_auth; the device registry renames the QR-time placeholder (Mobile <date>).UIApplicationSceneManifest+SceneDelegate) so builds with Xcode 27 / iOS 27 no longerSIGTRAPat launch (UIApplicationEvaluateRuntimeIssueForNoSceneLifecycleAdoption).Verified on physical iPhone 17 Pro Max (iOS 27 beta) after local Release install: app stays up and JS bundle loads.
Test plan
Mobile <date>cd mobile && pnpm exec vitest run src/transport/host-endpoint.test.ts src/transport/host-store-endpoint.test.ts src/transport/device-identity.test.tspnpm exec vitest run src/main/runtime/rpc/e2ee-channel.test.ts src/main/runtime/device-registry-name.test.ts(when root deps available)npx expo prebuild --platform iosthen build/run on iOS 27 simulator or device — app launches without SIGTRAPNotes
mobile/iosremains gitignored; the scene lifecycle change is applied viamobile/plugins/ios-uikit-scene-lifecycle.json prebuild.main.jsbundle.