Repository navigation
Conversation
|
Important Draft PR not reviewedDraft PRs are not automatically reviewed by default.
To automatically review draft PRs, update your CodeRabbit configuration: reviews:
auto_review:
drafts: true
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. |
Owner
|
Closing this stale draft PR. The iOS alert-routing parity gap is real, but |
devswha
added a commit
that referenced
this pull request
Nov 27, 2026
## Change A fresh take on #4236 (closed as stale), rebuilt on current `main` after its SSH PCs, build-scoped `PCStore.appOrigin`/`shellOrigin`, the hosted Home flow and the shell served from inside the app. Tapping a pane's alert in the iPhone app now opens that pane on the saved PC that sent it, as the Android app has done since #3935. - **`app/ios/OvisHomeCore/Sources/OvisHomeCore/Alert.swift`** (+ `AlertTests.swift`): the decisions alone, twin of Android's `PCStore.alertLink` / `alertTap` / `appPage`, with Android's test cases ported plus the iOS key forms: - `Alert.link`: the PC saved under the key its endpoint was kept under; else a relay PC by its relay ID, as the scope on the shell's own origin (`capacitor://app.ovis.sh/s/<id>/` in a store build that serves the shell itself, `https://app.ovis.sh/s/<id>/` in one that loads it). A relay ID never moves an alert from a PC's own address, or from another relay PC's scope, onto a scope; an endpoint kept under the hosted origin before the shell moved inside the app (`PCStore.settleShell`) is not the current pairing's and opens nothing. - `Alert.handsToPage` / `appPage`: the page on screen takes the pane when it is a page of the alert's PC and runs the app (not a reader, an API answer, `/ws` or a file). - `Alert.selectionScript`: the same `ovis-select-pane` dispatch as Android (worker message fallback for older pages), answering `true` so a page that could not run it gets the alert's address instead. - **`OvisPushPlugin.swift`**: `didReceive` → `tapped`: default action only; decrypts `userInfo["ovis"]` with the phone's keychain keys (nothing unencrypted steers navigation, and a tap works where the extension timed out), maps the alert's endpoint to the PC key it was stored under, opens each request once (a launching tap can come both ways). - **`HerdrBridgeViewController.swift`**: `openAlert` hands the pane to the PC page on screen (cover lifted, not being replaced), else opens the alert's PC with `PCStore.open` + `reopen()`, after dispatching `ovis-page-leaving` on a PC page on screen (waiting at most 1 s) so text it held in memory alone waits in Recover unsent text. Nothing happens while a sheet (SSH setup, scanner) is presented: dismissing it from here would skip its own `model.leave()`. Before the first screen exists it only makes the PC the one that opens. - **`SceneDelegate.swift`**: a tap that launched the app (`connectionOptions.notificationResponse`) is handled after `settleShell()` and before the first screen, so that screen opens the alert's PC at its pane. - **`docs/native-app.md`**, **`changelog.d/ios-alert-tap-opens-pane.md`**. Deliberate differences from Android, documented: a relay PC's page inside the hosted app the person kept as the PC is that relay PC's own, so its alert selects the pane in place (Android reloads at the scope); and the sheet rule above. No server, client or contract change: `server/push.ts` already names `endpoint` / `server_id` for every relay push. ## Validation On macOS 27 / Xcode 27.2 (Apple silicon): - `sh app/ios/check.sh`: OvisHomeCore 107 tests (7 new in `AlertTests`), OvisSshCore 72 (6 skipped, as on `main`), OvisPushCore 22, ScopePath and OpeningWatch checks — all pass. - `xcodebuild` of `App` + `OvisNotifications`: Debug for the iOS Simulator, and Release for `generic/platform=iOS` with `CODE_SIGNING_ALLOWED=NO`; both succeed, no new warnings (the 12 left are in SSH and barcode-scanner files). - Simulator run (iPhone 17, iOS 27.2) of the real app built from this branch with `bun run build:web` + `cap sync ios`, against two stub Ovis PCs on loopback (answering `/api/health?scope=bridge`, logging page loads, `ovis-select-pane` and `ovis-page-leaving`) and a stub push relay (`OVIS_PUSH_RELAY` override). The app subscribed through `OvisPush` (real simulator APNs token, real keychain keys); each alert was the PC's JSON encrypted for that subscription (RFC 8291 via `web-push`) and delivered with `xcrun simctl push`, its banner tapped with AXe. 6/6 cases passed: 0. alert naming no endpoint/relay ID → nothing selected or loaded 1. alert for the PC on screen (app page) → `select-pane` `{pane_id, machine_id, workspace_id, view: chat}`, no reload 2. alert for the other saved PC → `page-leaving` on the old page, then the other PC loads at `/?machine=local&ws=w2&pane=w2%3Ap2&view=chat` 3. alert for the PC on screen at `/?read=notes.md` → `page-leaving`, then its address loads (no select) 4. same as 2 with the app in the background (behind Settings) 5. app not running → the tap launches it straight onto the alert's PC at its pane, exactly one page load - `bun run check fast`: workflow syntax skipped, generated types/themes fresh, typecheck and build ok; unit tests fail in 18 server/scripts files with 28 failing tests. The same 28 (plus 4 timing ones) fail on a clean `main` checkout on this Mac (case-insensitive file names, `/proc`, sockets, SQLite WAL, SSH), and this PR changes no TypeScript. - Not run: a real iPhone with live alerts (only a Personal Team on this Mac; the relay's APNs key is the `sh.ovis.app` team's), a relay PC end to end (covered by `AlertTests`), and the Integration, Windows and container CI jobs (left to CI). 🤖 Generated with [Claude Code](https://claude.com/claude-code) --------- Co-authored-by: Jimmy <[email protected]> Co-authored-by: Claude Opus 5.5 <[email protected]> Co-authored-by: devswha <[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.
Change
Implements iOS parity with #3935 so tapping a push notification in the iOS app opens the pane the alert is about on the saved PC that sent it, instead of only bringing the app forward on whatever screen it last showed.
app/ios/OvisPushCore/Sources/OvisPushCore/AlertRouting.swift(plusAlertRoutingTests.swift): resolves decrypted alert payloads (pane_id,machine_id,workspace_id,endpoint,server_id) to a saved direct PC or relay PC scope, mirrors Android'sPCStore.alertLink/alertTap/appPage/selectionScriptrules, and handles iOS's scopedUserDefaultsendpoint keys (https://app.ovis.sh/s/<server_id>/).app/ios/App/App/OvisPushPlugin.swift: implementsdidReceive(response:)(default tap action only), decryptsuserInfo["ovis"]with the phone's Keychain keys (so a tap works even if the Notification Service Extension timed out, and nothing unencrypted inuserInfocan steer navigation), deduplicates by notification request identifier, and re-bindsUNUserNotificationCenter.current().delegate = routeronload()soreopen()never leaves the delegate pointing at a deallocated router.app/ios/App/App/HerdrBridgeViewController.swift:openAlert(...): deliversovis-select-pane(withnavigator.serviceWorkerfallback for older HTTPS PCs) directly into the open WebView without reloading when the alert is for the PC and app page already shown; otherwise setsPCStore.current/pendingStartand reopens on the alert's URL.reopen(): dispatchesovis-page-leaving(waiting up to 1 s) before tearing down an open PC WebView so in-memory unsent drafts carry over to recovery when switching PCs.app/ios/App/App/SceneDelegate.swift: handlesconnectionOptions.notificationResponsebefore creating the initialHerdrBridgeViewControllerso cold launches from a notification tap open the alert's PC and pane directly.docs/native-app.mdandchangelog.d/ios-alert-tap-opens-pane.md: updated to reflect iOS alert-tap navigation.Validation
bun run check faston Linux:workflow syntax,generate:types --check,generate:themes --check,typecheck,build,scripts/changelog-fold.test.ts(12/12), and 19,452/19,454 unit tests passed (the 2 unrelated failures weresrc/lib/useAddressBar.hook.test.tson local Bun 1.4.2 andserver/lan-https.test.ts).cd app/ios/OvisPushCore && swift teston macOSApp+OvisNotifications