iOS: private-AX snapshot drops focused for a keyboard-focused text input (bridge reads only hasFocus)
メンテナーはふだん 1 日以内に返信
まだ誰も着手していません。
評価
- 難易度
- 2/5
- 見積もり時間
- 1〜3時間
- 初心者へのやさしさ
- 74/100
- issue の種類
- バグ
- 明瞭さ
- 明確に書かれている
- 活発さ
- 活発
- 技術スタック
- ios, objective-c
- 領域
- mobile-dev, testing
調査の方向性
RunnerAXSnapshotBridge.m の 730 行目付近にある dictionaryForSnapshot: から始め、その focused のマッピングを、issue で説明されている focusBool の動作と比較してください。この変更によって、private-AX スナップショットがキーボードフォーカスを持つテキスト入力をフォーカス済みとして報告することを確認し、続いて、報告されたフォーカスが XCTest のプロデューサーと一致することを検証してください。
索引モデルが issue の本文から書いたものです。
説明
What happens
On an iOS simulator, focused flips to false for a focused text input whenever the snapshot comes from the runner's private-AX backend. The field is being edited: the keyboard is visible and the selection grabbers are in the tree. But is focused / toBeFocused keeps failing until the backend switches back.
Cause
RunnerAXSnapshotBridge.m dictionaryForSnapshot: sets focused only from hasFocus:
result[@"focused"] = [self boolNumberForKey:@"hasFocus" snapshot:snapshot defaultValue:NO];
#2925 changed the XCTest producers (focusBool) to hasKeyboardFocus || hasFocus. The private-AX producer was left on hasFocus. A text input under the software keyboard holds hasKeyboardFocus, not hasFocus. #3163 fixed the same gap in the host-side snapshot-source/tree.ts decoder, but the runner's Objective-C bridge still has it on main (line 730).
The bug only shows when the XCTest channel is penalized. One queries_backend_timeout sends every snapshot to private-ax for snapshotXCTestChannelPenaltyDuration (120 s). A focus assertion that lands inside that window fails every poll. Outside it, the tree backend answers correctly. On a busy React Native screen this makes the failure intermittent.
Evidence (0.21.28, iOS 27.0 simulator, Xcode 27.1)
I instrumented both producers to log the raw KVC values for the composer textbox on every snapshot, then ran one chat thread-reply test 20 times:
| backend | hasFocus |
hasKeyboardFocus |
snapshot focused |
|---|---|---|---|
| xctest (tree) | 0 | 1 | true |
| private-ax | 0 | 1 | absent |
- 4 of 20 runs failed
toBeFocused. Each failure started right afterSNAPSHOT_XCTEST_CHANNEL_PENALIZED reason=queries_backend_timeout, and every snapshot in the failing window wasPRIVATE_AX_SNAPSHOT_USED. - With the private-AX snapshot,
[snapshot valueForKey:@"hasKeyboardFocus"]returns 1 on the focused field. - After changing that one line to
hasKeyboardFocus || hasFocus, the same test passed 20/20, with the private-AX backend serving 200+ snapshots in every run.
Fix
result[@"focused"] = @([[self boolNumberForKey:@"hasKeyboardFocus" snapshot:snapshot defaultValue:NO] boolValue]
|| [[self boolNumberForKey:@"hasFocus" snapshot:snapshot defaultValue:NO] boolValue]);
This matches focusBool, so both producers report the same focused for the same element. We carry it as a bun patch on 0.21.28 until a release ships it.
Related: #4110 (we drive the same patched runner remotely).
- 主要言語
- TypeScript
- スター
- 5.2k
- フォーク
- 359
- 平均マージ
- 13時間 31分
- マージ済み PR(30日)
- 664
環境構築
- Dockerfile・Docker Compose ファイルなし
- プルリクエストのテンプレートなし
- コントリビューションガイドを読む
はじめの一歩
- issue を最後まで読み、次にプロジェクトのコントリビューションガイドを読みます。
- 着手することを issue にコメントします — 二人が同じ作業をするのを防げます。
- リポジトリをフォークし、ブランチを切って変更します。
- issue 番号を参照したプルリクエストを送ります。
callstack/agent-device のほかの issue
-
iOS alert wait: the last poll can get ~30 ms and turns "no alert" into a failed read対応中かも @pcbeingused333 が 2 日前に担当しました。 オープンbug ready-for-agent
難易度 2/5 1〜3時間 初心者へのやさしさ 77/100
callstack/agent-device#4018 ·
メンテナーはふだん 1 日以内に返信
-
難易度 2/5 1〜3時間 初心者へのやさしさ 68/100
callstack/agent-device#1869 ·
メンテナーはふだん 1 日以内に返信
-
iOS input fails in 0.21.34+ when Apple tools resolve past a stale Xcode selection symlink対応中かも @thymikee が 1 日前に担当しました。 オープン
難易度 4/5 3〜5日 初心者へのやさしさ 22/100
callstack/agent-device#4145 ·
メンテナーはふだん 1 日以内に返信
-
難易度 3/5 半日 初心者へのやさしさ 48/100
callstack/agent-device#4142 ·
メンテナーはふだん 1 日以内に返信
-
enhancement
難易度 4/5 3〜5日 初心者へのやさしさ 43/100
callstack/agent-device#4110 · コメント 1 件 ·
メンテナーはふだん 1 日以内に返信
callstack/agent-device の issue をすべて見る
似ている issue
-
難易度 2/5 1〜3時間 初心者へのやさしさ 62/100
oxidecomputer/skepsis#102 · コメント 1 件 ·
メンテナーはふだん 1 日以内に返信
-
難易度 2/5 1〜3時間 初心者へのやさしさ 62/100
voidzero-dev/void#677 ·
メンテナーはふだん 1 日以内に返信
-
難易度 2/5 1〜3時間 初心者へのやさしさ 68/100
メンテナーはふだん 1 日以内に返信
-
難易度 2/5 1〜3時間 初心者へのやさしさ 78/100
kunchenguid/gh-axi#247 ·
メンテナーはふだん 1 日以内に返信
-
bug
難易度 2/5 1〜3時間 初心者へのやさしさ 72/100
lidge-jun/opencodex#8101 · コメント 2 件 ·
メンテナーはふだん 1 日以内に返信