iOS: private-AX snapshot drops focused for a keyboard-focused text input (bridge reads only hasFocus)
Los mantenedores suelen responder en 1 día
Ya se ha fusionado un pull request relacionado.
- #4154 de @thymikee — fusionado
Evaluación
- Dificultad
- 2/5
- Tiempo estimado
- 1-3 horas
- Aptitud para principiantes
- 74/100
- Tipo de issue
- Error
- Claridad
- Bien especificado
- Estado de actividad
- Activo
- Stack tecnológico
- ios, objective-c
- Área
- mobile-dev, testing
Línea de trabajo
Empieza en RunnerAXSnapshotBridge.m, en dictionaryForSnapshot: alrededor de la línea 730, y compara su asignación de focused con el comportamiento de focusBool descrito en el issue. Confirma que el cambio hace que las instantáneas de private-AX informen como enfocado un campo de texto con el foco del teclado y, luego, verifica que el foco informado coincida con el productor de XCTest.
Escrito por el modelo de indexación a partir del texto del issue.
Descripción
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).
- Lenguaje dominante
- TypeScript
- Estrellas
- 5.2k
- Forks
- 359
- Merge medio
- 13 h 31 min
- PR fusionados (30 d)
- 664
Preparar el entorno
- Sin Dockerfile ni archivo de Docker Compose
- Sin plantilla de pull request
- Leer la guía de contribución
Primeros pasos
- Lee el issue completo y luego la guía de contribución del proyecto.
- Comenta en el issue que vas a ocuparte — evita que dos personas hagan lo mismo.
- Haz un fork del repositorio y trabaja en una rama.
- Abre un pull request que haga referencia al número del issue.
Más de callstack/agent-device
-
iOS alert wait: the last poll can get ~30 ms and turns "no alert" into a failed readPosiblemente ocupada @pcbeingused333 la tomó hace 2 días. Abiertobug ready-for-agent
Dificultad 2/5 1-3 horas Aptitud para principiantes 77/100
callstack/agent-device#4018 ·
Los mantenedores suelen responder en 1 día
-
Dificultad 2/5 1-3 horas Aptitud para principiantes 68/100
callstack/agent-device#1869 ·
Los mantenedores suelen responder en 1 día
-
Dificultad 4/5 3-5 días Aptitud para principiantes 18/100
callstack/agent-device#4179 ·
Los mantenedores suelen responder en 1 día
-
Daemon: refuse leased requests that name no session at request admissionPosiblemente ocupada @airowe la tomó hoy. Abiertobug ready-for-agent
Dificultad 4/5 3-5 días Aptitud para principiantes 25/100
callstack/agent-device#4171 ·
Los mantenedores suelen responder en 1 día
-
enhancement needs-triage
Dificultad 4/5 3-5 días Aptitud para principiantes 35/100
callstack/agent-device#4162 · 1 comentario ·
Los mantenedores suelen responder en 1 día
Todos los issues de callstack/agent-device
Issues similares
-
area: cli bug flake ready-for-agent
Dificultad 2/5 1-3 horas Aptitud para principiantes 62/100
gazetta-studio/gazetta-studio#1772 ·
Los mantenedores suelen responder en 1 día
-
Dificultad 2/5 1-3 horas Aptitud para principiantes 82/100
-
needs-triage
Dificultad 2/5 1-3 horas Aptitud para principiantes 66/100
microsoft/playwright#43875 · 1 comentario ·
Los mantenedores suelen responder en 1 día
-
README translations: ja, ko, deAbiertodocumentation good first issue
Dificultad 2/5 1-3 horas Aptitud para principiantes 68/100
Los mantenedores suelen responder en 1 día
-
feature
Dificultad 2/5 1-3 horas Aptitud para principiantes 78/100
calagopus/panel#285 · 1 comentario ·
Los mantenedores suelen responder en 1 día