Skip to content

iOS: a coordinate press on a notification banner activates the session app first (stale_target), so the banner never gets the tap #4655

Closed

Description

@nstfn

Purpose

With the session app in the background (Home Screen in front), a push notification banner is on screen. press <x> <y> on the banner does not open the notification. Before the tap, the runner re-activates the session app (targetActivation {reason: stale_target, priorState: 3}), the banner goes away, and the tap lands on the app's current screen. The notification's deep link is never opened.

With the app already in front, the same push and the same press open the notification's deep link. So the banner and the coordinates are fine. The pre-tap activation is the difference.

A press at a point targets the screen, not an element of the session app. The point may belong to a system surface (banner, alert, Control Center). Activating the session app first changes what is under the point.

Environment

  • agent-device 0.21.39 (npm). RunnerTests+CommandDispatch.swift is unchanged on main at 655ede279. First seen on 0.21.29.
  • macOS 27.2.1 (26B131), Xcode 27.2 (27B52), Node 24.21.0.
  • iPhone 17 Simulator, iOS 27.2 (24B8117), language fr-FR.
  • App: a production iOS app with a third-party push SDK; notifications authorized through the app's own prompt.

Reproduction

pin='--platform ios --device <sim> --session s --state-dir <dir> --json'
# The app is open on its home screen.
agent-device home $pin                                   # Home Screen in front, app in background
xcrun simctl push <udid> <bundle> deeplink.apns          # alert push whose deep link opens the Settings page
# The banner shows at the top (screenshot), centre about (201, 91) pt.
agent-device press 201 91 $pin
#   {"success": true, "data": {"x": 201, "y": 91, "message": "Tapped (201, 91)", "targetKind": "point",
#    "targetActivation": {"priorState": 3, "reason": "stale_target", "otherActiveApplicationPid": 79623}}}
# runner.log:
#   AGENT_DEVICE_RUNNER_ACTIVATE bundle=<bundle> state=3 reason=stale_target
#   AGENT_DEVICE_RUNNER_ACTIVATE_FACT bundle=<bundle> reason=stale_target priorState=3 otherActiveApplicationPid=79623
# Screen 2 s later and the next snapshot: the app's home, not the Settings page. Same app pid before and after.

2 runs of 2. We ran no snapshot between home and the press, because a snapshot also re-activates the app.

Control, 2 runs of 2: the app in front on its home, the same push, press 201 91. The answer has no targetActivation, and the app opens the Settings page.

Cause (source at v0.21.39)

Required behavior

One of:

  • A point press does not activate the session app first, or
  • a flag or option lets the caller skip the activation for one command, or
  • the press refuses before dispatch (dispatched: no) with a reason that says the session app is not in front, instead of activating it.

In each case, a tap on a banner over the Home Screen reaches the banner.

Example shape for the third option (the reason name is only a suggestion):

{"success": false, "error": {"code": "COMMAND_FAILED",
  "details": {"reason": "session_app_not_foreground", "priorState": 3, "dispatched": "no"}}}

Completion conditions

  • The reproduction above opens the notification's deep link, or answers a typed refusal with dispatched: no.
  • targetActivation stays reported whenever an activation does happen.

Dependencies

Blocked by: none.

Related: #4557 (observe the frontmost app without activating it) needs a decision on the same activation contract. #2682 made the activation visible.

Workaround

Tap a banner only while the session app is in front. To test a cold or background open of a deep link, use xcrun simctl openurl instead of a banner.

Activity

  1. added
    bug
    in-progress
    on Nov 18, 2026
  2. thymikee commented on Nov 21, 2026

    @thymikee
    Member

    An agent is picking this up; the PR will link here.

  3. removed
    in-progress
    on Nov 21, 2026
  4. added a commit that references this issue on Nov 21, 2026
    da3d360
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Metadata

Metadata

Assignees

No one assigned

    Labels

    bug

    Type

    No type

    Projects

    No projects

      Milestone

      No milestone

      Relationships

      None yet

      Development

      No branches or pull requests

      Issue actions