iOS: alert dismiss taps "Allow" on the App Tracking Transparency prompt
维护者通常 1 天内回复
还没有人认领这个 Issue。
评估
调研方向
问题出在 apple/runner/AgentDeviceRunner/AgentDeviceRunnerUITests/RunnerTests+Alert.swift 中的 chooseAlertButton,其 dismiss 回退逻辑返回了 buttons.last。请先查看 isDismissButton 的标签列表和 dismiss 分支,并与 accept 分支中已有的保护条件进行比较。当 "Ask App Not to Track" 被识别为 dismiss 标签,或 dismiss 回退逻辑不再选中 accept 类按钮,并且在模拟器运行时 ATT 弹窗让跟踪保持为 denied,即为完成。
由索引模型根据 Issue 内容生成。
描述
Problem
On an iOS simulator, alert dismiss on the App Tracking Transparency prompt (buttons "Ask App Not to Track" and "Allow") taps "Allow". The command prints dismissed and exits 0, but iOS records an authorization, exactly as after alert accept.
Nothing in the output reveals it: a test that dismisses the prompt to decline tracking silently runs the app with tracking authorized.
Environment
- agent-device 0.21.24 (code unchanged in 0.21.27,
0.21.28-nightly.20261014.57andmainat 542fb77, see Cause) - macOS 26.6.2, Xcode 27.0, Node 24.21.0
- Simulator: iPhone 17, iOS 27.0, English locale
- Target app: an Expo development build that calls
requestTrackingAuthorizationon launch
Reproduction
xcrun simctl privacy "$SIM" reset all <bundle id> # ATT status back to notDetermined
npx agent-device open <bundle id> --platform ios --udid "$SIM" --relaunch
npx agent-device alert wait 15000 # "Allow “<app>” to track your activity across other companies’ apps and websites?"
npx agent-device alert dismiss # "dismissed", exit code 0
sqlite3 ~/Library/Developer/CoreSimulator/Devices/"$SIM"/data/Library/TCC/TCC.db \
"select auth_value from access where service='kTCCServiceUserTracking' and client='<bundle id>'"
The development build was opened with --launch-url and its dev-client deep link; any app that requests tracking authorization on launch shows the same prompt. auth_value is 0 when tracking is denied and 2 when it is authorized.
| Response to the prompt | Runs | auth_value |
|---|---|---|
alert dismiss |
4 | 2 (authorized), 4 of 4 |
alert accept |
— | 2 (authorized) |
find text "Ask App Not to Track" click, or click on the button ref |
4 | 0 (denied), 4 of 4 |
Cause
chooseAlertButton in RunnerTests+Alert.swift:
return buttons.first(where: { isDismissButton($0.label) }) ?? buttons.last
"Ask App Not to Track" is not in the isDismissButton list (cancel, close, dismiss, don't allow, not now, no, keep browsing, later), so dismiss falls back to buttons.last, which is "Allow" on this prompt.
The accept branch already guards against the symmetric mistake: when no accept label matches, it only taps a lone button that is not a dismiss button. The dismiss branch has no such guard and can tap a button that isAcceptButton recognizes ("allow").
Suggested fix
Either or both:
- add "ask app not to track" to the dismiss labels;
- in the
dismissfallback, never pick a button thatisAcceptButtonmatches (e.g. the last button that is not an accept button), and fail when every button is an accept button, rather than tap one.
The second keeps dismiss from authorizing on any prompt whose decline label is unknown, including localized ones.
Expected behavior
alert dismiss on the App Tracking Transparency prompt taps "Ask App Not to Track", or fails without tapping, and never records an authorization.
- 主要语言
- TypeScript
- 星标
- 5k
- 派生
- 334
- 平均合并
- 13 小时 19 分钟
- 30 天内合并 PR
- 630
环境准备
- 没有 Dockerfile 或 Docker Compose 文件
- 没有 Pull Request 模板
- 阅读贡献指南
从这里开始
- 先读完整个 Issue,再读项目的贡献指南。
- 在 Issue 下留言说明你要接手 —— 这能避免两个人做同样的事。
- Fork 仓库,在一个分支上完成修改。
- 提交 Pull Request,并在描述里引用这个 Issue 编号。
callstack/agent-device 的其他 Issue
-
难度 1/5 1 小时以内 新手友好度 88/100
callstack/agent-device#3353 ·
维护者通常 1 天内回复
-
难度 2/5 1-3 小时 新手友好度 68/100
callstack/agent-device#1869 ·
维护者通常 1 天内回复
-
iOS 26: `_UIFloatingBarContainerView` marks sheet content (and sometimes whole screens) as covered未关闭
难度 4/5 3-5 天 新手友好度 35/100
callstack/agent-device#3628 ·
维护者通常 1 天内回复
-
on-hold refactor
难度 2/5 1-3 小时 新手友好度 40/100
callstack/agent-device#3607 ·
维护者通常 1 天内回复
-
enhancement ready-for-agent
难度 5/5 一周以上 新手友好度 35/100
callstack/agent-device#3531 · 1 条评论 ·
维护者通常 1 天内回复
查看 callstack/agent-device 的全部 Issue
相似的 Issue
-
难度 2/5 1-3 小时 新手友好度 74/100
xdjs/MusicNerdWeb#1532 ·
维护者通常 1 天内回复
-
bug
难度 2/5 1-3 小时 新手友好度 72/100
sebastian-software/ardo#352 ·
维护者通常 1 天内回复
-
@react95/core good first issue
难度 1/5 1 小时以内 新手友好度 88/100
维护者通常 3 天内回复
-
@shikijs/stream: `ShikiStreamTokenizer.clone()` shares its `tokensStable` array with the original可能已有人在做 @xyrolle 今天认领。 未关闭
难度 2/5 1-3 小时 新手友好度 82/100
维护者通常 6 天内回复
-
难度 2/5 1-3 小时 新手友好度 72/100
维护者通常 1 天内回复