Skip to content

Commit ae5df2e

Browse files
committed
Split the keyboard flow into Home and a conversation so each fits its 2-minute deadline, and retry a flow once when Maestro's driver errors (read from its report too).
Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com> Claude-Session: https://claude.ai/code/session_012xYtaUjbkB1hwLtK4TEzhq
1 parent ece622d commit ae5df2e

4 files changed

Lines changed: 66 additions & 40 deletions

File tree

‎rn-shell/COMPARISON.md‎

Lines changed: 16 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -55,6 +55,22 @@ Every place the RN shell drops to native code or configuration:
5555
| Downloads on iOS | `onFileDownload` gives an address only (no cookies, no file) | The share sheet with the address; the native shell downloads the file with the session |
5656
| A system tab bar | Expo Router's native tabs host a screen per tab; the one web view would have to be re-parented | Tabs drawn by React Native: no iOS 26 glass, not `BottomNavigationView` |
5757

58+
### The senior review's rules: where each one lives in React Native
59+
60+
| Rule | In JavaScript (react-native-webview's API) | Needed native code or a patch | Not possible with react-native-webview as it is |
61+
| --- | --- | --- | --- |
62+
| Clear the web view's session and site data before `enter`, and load `enter` only when that has finished | The waiting (the reducer holds `enter` until `siteDataCleared`) | Clearing: WKWebsiteDataStore / CookieManager and WebStorage in the module; react-native-webview's `clearCache` is per view, Android-only for history, and gives no completion | |
63+
| Is there a session cookie (names only) | | The module (WKHTTPCookieStore, CookieManager) | |
64+
| An `enter` that ends on `/sign?native-sign-in=failed` is a failure | Yes (the URL is in `onNavigationStateChange`) | | |
65+
| During a renewal, ignore the outgoing page's `signed-out` and `/sign` | Yes (reducer) | | |
66+
| Keep the verifier after a fake ticket | Yes (reducer) | Android: the trampoline keeps another app's callback from bringing the app forward | |
67+
| Downloads only from the own origin | iOS: `onFileDownload` gives the address, so the app decides (share sheet, no cookies) | | Android: react-native-webview hands every download to DownloadManager itself, from any origin (a patch would be needed) |
68+
| Microphone and camera only for the own origin (scheme, host and port) | Refused for every origin (`mediaCapturePermissionGrantType="deny"`, no Android permission declared) | | Per-origin grant: iOS offers only "same host" (not scheme or port), Android grants by the app's permissions, not the page's origin |
69+
| `mailto:`, `tel:`, `sms:` from a new window | Yes: `onOpenWindow` gives the address, opened after a recent tap | | Telling a tap from a script: Android's window event carries no gesture flag (the app tracks taps in the page instead) |
70+
| Bridge from the main frame of the own origin only | The token and origin check | | A frame check: the message event has no frame on Android and the channel is open to all frames |
71+
| Dialogs: other origins suppressed, own titled OpenBot | Other origins' main-frame dialogs (an injected script) | The patch (frames, title) | |
72+
| A dead content process recovers | Yes (`onContentProcessDidTerminate`, `onRenderProcessGone`, a remount) | | |
73+
5874
Further friction found while building it:
5975

6076
- **A store build shipped the test hooks until Metro's cache was cleared.** `EXPO_PUBLIC_` values are

‎rn-shell/ci/run_flows.py‎

Lines changed: 7 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -44,7 +44,8 @@
4444
("handoff-sign-in", "flows/02-handoff-sign-in.yaml", "both", None, 120),
4545
("first-screen", "flows/01-first-screen.yaml", "both", None, 120),
4646
("tabs", "flows/03-tabs.yaml", "both", None, 120),
47-
("keyboard", "flows/04-keyboard.yaml", "both", None, 120),
47+
("keyboard-home", "flows/04-keyboard.yaml", "both", None, 120),
48+
("keyboard-conversation", "flows/04b-keyboard-conversation.yaml", "both", None, 120),
4849
("relaunch-signed-in", "flows/05-relaunch-signed-in.yaml", "both", None, 120),
4950
("skeleton", "flows/08-skeleton.yaml", "both", None, 120),
5051
("web-fallback", "flows/07-web-fallback.yaml", "both", None, 120),
@@ -72,7 +73,7 @@
7273
PRIVATE = {"real-signed-in-journey"}
7374
# The mock suite in two shards that can run on two machines (each with its own mock stacks): the
7475
# hand-off journey, which ends with sign-out, and the flows signed in with the mock's cookie.
75-
SHARD_1 = {"handoff-sign-in", "first-screen", "tabs", "keyboard", "relaunch-signed-in", "skeleton", "web-fallback",
76+
SHARD_1 = {"handoff-sign-in", "first-screen", "tabs", "keyboard-home", "keyboard-conversation", "relaunch-signed-in", "skeleton", "web-fallback",
7677
"sign-out", "foreign-callback"}
7778

7879

@@ -203,9 +204,11 @@ def run(platform, suite, artifacts, private, only, shard=0):
203204
while True:
204205
attempts += 1
205206
status, reason = run_one(args, flow_dir, timeout)
206-
log_text = (flow_dir / "maestro.log").read_text() if (flow_dir / "maestro.log").exists() else ""
207+
log_text = "".join(
208+
(flow_dir / name).read_text() for name in ("maestro.log", "report.xml") if (flow_dir / name).exists()
209+
)
207210
# Maestro's own driver dying (after a killed run) is not the app's failure: once more.
208-
if status == "failed" and attempts == 1 and re.search(r"DeviceServerDied|StatusRuntimeException: UNAVAILABLE|XCTestDriver.*(unreachable|failed)", log_text):
211+
if status == "failed" and attempts == 1 and re.search(r"DeviceServerDied|StatusRuntimeException: UNAVAILABLE|XCTestDriver.*(unreachable|failed)|<failure>Unknown error</failure>", log_text):
209212
print(" Maestro's driver died; running the flow again", flush=True)
210213
continue
211214
break
Lines changed: 2 additions & 36 deletions
Original file line numberDiff line numberDiff line change
@@ -1,6 +1,5 @@
1-
# The keyboard: the web view ends at its top edge (Send stays above it), the tab bar hides while it is
2-
# up and comes back after, and a drag down on a page that does not scroll (Home) puts it away. In a
3-
# conversation, sending keeps it up.
1+
# The keyboard on Home: the web view ends at its top edge (Send stays above it), the tab bar hides
2+
# while it is up and comes back after, and a drag down on a page that does not scroll puts it away.
43
appId: ai.openbot.rnshell
54
# Android: read the web view's content through DevTools (test builds enable web view debugging);
65
# Chromium's accessibility tree is sometimes not populated when UiAutomator asks.
@@ -30,36 +29,3 @@ androidWebViewHierarchy: devtools
3029
- assertVisible:
3130
id: "tab-bar"
3231
- takeScreenshot: home-keyboard-down
33-
- tapOn:
34-
id: "tab-conversations"
35-
- extendedWaitUntil:
36-
visible: "Quarterly forecast"
37-
timeout: 20000
38-
- tapOn: "Quarterly forecast"
39-
- extendedWaitUntil:
40-
visible: "Here is the first draft."
41-
timeout: 20000
42-
# The conversation may have focused its box already; tap it either way.
43-
- tapOn: "(Message|Ask anything)"
44-
- extendedWaitUntil:
45-
visible:
46-
id: "debug-state"
47-
text: ".*keyboard=1.*"
48-
timeout: 10000
49-
- inputText: "What changed?"
50-
- assertVisible: "Send message"
51-
- takeScreenshot: conversation-keyboard
52-
- tapOn: "Send message"
53-
- assertVisible:
54-
id: "debug-state"
55-
text: ".*keyboard=1.*"
56-
- takeScreenshot: conversation-sent
57-
- tapOn:
58-
id: "tab-home"
59-
- extendedWaitUntil:
60-
visible:
61-
id: "debug-state"
62-
text: ".*keyboard=0.*tab=home.*|.*tab=home.*keyboard=0.*"
63-
timeout: 10000
64-
- assertVisible:
65-
id: "tab-bar"
Lines changed: 41 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,41 @@
1+
# The keyboard in a conversation: the message box and Send above it, sending keeps it up, a tab tap
2+
# puts it away and the tab bar comes back.
3+
appId: ai.openbot.rnshell
4+
# Android: read the web view's content through DevTools (test builds enable web view debugging);
5+
# Chromium's accessibility tree is sometimes not populated when UiAutomator asks.
6+
androidWebViewHierarchy: devtools
7+
---
8+
- runFlow: ../subflows/launch-signed-in.yaml
9+
- tapOn:
10+
id: "tab-conversations"
11+
- extendedWaitUntil:
12+
visible: "Quarterly forecast"
13+
timeout: 20000
14+
- tapOn: "Quarterly forecast"
15+
- extendedWaitUntil:
16+
visible: "Here is the first draft."
17+
timeout: 20000
18+
# The conversation may have focused its box already; tap it either way.
19+
- tapOn: "(Message|Ask anything)"
20+
- extendedWaitUntil:
21+
visible:
22+
id: "debug-state"
23+
text: ".*keyboard=1.*"
24+
timeout: 10000
25+
- inputText: "What changed?"
26+
- assertVisible: "Send message"
27+
- takeScreenshot: conversation-keyboard
28+
- tapOn: "Send message"
29+
- assertVisible:
30+
id: "debug-state"
31+
text: ".*keyboard=1.*"
32+
- takeScreenshot: conversation-sent
33+
- tapOn:
34+
id: "tab-home"
35+
- extendedWaitUntil:
36+
visible:
37+
id: "debug-state"
38+
text: ".*keyboard=0.*tab=home.*|.*tab=home.*keyboard=0.*"
39+
timeout: 10000
40+
- assertVisible:
41+
id: "tab-bar"

0 commit comments

Comments
 (0)