iOS: private-AX snapshot drops focused for a keyboard-focused text input (bridge reads only hasFocus)
Les mainteneurs répondent en général sous 1 jour
Une pull request liée a déjà été fusionnée.
- #4154 par @thymikee — fusionnée
Évaluation
- Difficulté
- 2/5
- Temps estimé
- 1-3 heures
- Accessibilité débutants
- 74/100
- Type d'issue
- Bug
- Clarté
- Clairement spécifiée
- Activité
- Active
- Stack technique
- ios, objective-c
- Domaine
- mobile-dev, testing
Piste de recherche
Commencez dans RunnerAXSnapshotBridge.m, au niveau de dictionaryForSnapshot: vers la ligne 730, et comparez son association de focused au comportement de focusBool décrit dans l’issue. Confirmez que la modification fait en sorte que les instantanés private-AX signalent comme focalisé un champ de saisie texte ayant le focus clavier, puis vérifiez que le focus signalé correspond au producteur XCTest.
Rédigé par le modèle d'indexation à partir du texte de l'issue.
Description
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).
- Langage dominant
- TypeScript
- Étoiles
- 5.3k
- Forks
- 377
- Merge moyen
- 13 h 18 min
- PR mergées (30 j)
- 653
Préparer son environnement
- Aucun Dockerfile ni fichier Docker Compose
- Aucun modèle de pull request
- Lire le guide de contribution
Par où commencer
- Lisez l'issue en entier, puis le guide de contribution du projet.
- Signalez en commentaire que vous la prenez — cela évite que deux personnes fassent le même travail.
- Forkez le dépôt et travaillez sur une branche.
- Ouvrez une pull request qui référence le numéro de l'issue.
Autres issues de callstack/agent-device
-
bug ready-for-agent
Difficulté 2/5 1-3 heures Accessibilité débutants 90/100
callstack/agent-device#4212 · 1 commentaire ·
Les mainteneurs répondent en général sous 1 jour
-
iOS alert wait: the last poll can get ~30 ms and turns "no alert" into a failed readPeut-être pris @pcbeingused333 l’a pris il y a 4 jours. Ouvertebug ready-for-agent
Difficulté 2/5 1-3 heures Accessibilité débutants 77/100
callstack/agent-device#4018 ·
Les mainteneurs répondent en général sous 1 jour
-
Difficulté 2/5 1-3 heures Accessibilité débutants 68/100
callstack/agent-device#1869 ·
Les mainteneurs répondent en général sous 1 jour
-
iOS 27: HealthKit's authorization sheet reads as one node, so label and ref presses can't reach itOuverte
Difficulté 4/5 3-5 jours Accessibilité débutants 48/100
callstack/agent-device#4226 ·
Les mainteneurs répondent en général sous 1 jour
-
Difficulté 4/5 3-5 jours Accessibilité débutants 70/100
callstack/agent-device#4216 ·
Les mainteneurs répondent en général sous 1 jour
Toutes les issues de callstack/agent-device
Issues similaires
-
Difficulté 2/5 1-3 heures Accessibilité débutants 78/100
Open-Earth-Foundation/CityCatalyst#3399 ·
Les mainteneurs répondent en général sous 2 jours
-
userReport
Difficulté 1/5 Moins d'une heure Accessibilité débutants 72/100
nkprasad12/morcus-net#631 ·
Les mainteneurs répondent en général sous 1 jour
-
fix(app): fail closed if GetGeneralSetting fails during initializationPeut-être pris @kalavt l’a pris aujourd’hui. Ouvertebug
Difficulté 2/5 1-3 heures Accessibilité débutants 76/100
Les mainteneurs répondent en général sous 1 jour
-
Difficulté 1/5 Moins d'une heure Accessibilité débutants 85/100
nekko-labs/nekko-agent#1756 ·
Les mainteneurs répondent en général sous 1 jour
-
needs-area-label
Difficulté 2/5 1-3 heures Accessibilité débutants 66/100
Les mainteneurs répondent en général sous 2 jours