Hacktoberfest 2026:维护者为十月标记出来的 issue,仍然开放、适合新手。 浏览 Hacktoberfest issue

iOS: a canceled request releases the session lock while its runner command still runs on the device

已关闭
#3,383 0 条评论 0 个 reaction 已指派 0 人 在 GitHub 查看

维护者通常 1 天内回复

已经有一个关联 PR 被合并了。

  • #3385 来自 @thymikee —— 已合并

评估

难度
4/5
预计耗时
3-5 天
新手友好度
22/100
Issue 类型
缺陷
描述清晰度
描述清楚
活跃度
停滞
技术栈
ios, typescript
领域
backend, mobile

调研方向

Start in src/daemon/request-execution-locks.ts and packages/kernel/src/keyed-lock.ts to see when the session and device locks are released, then in packages/platform-apple/src/runner/runner-exchange.ts where an abandoned charge is marked. Done means a test in which a canceled runner command keeps the session lock until the runner journal reports it terminal, plus the live iOS press-then-relaunch check. Linked PR #3385 is already open against this, so check it before starting.

由索引模型根据 Issue 内容生成。

描述

Problem

A per-call signal (#3178) cancels a request, but on iOS the daemon releases the session's lock before the device has finished the canceled work. The next request on the same session can then run while the aborted command is still executing on the device.

  • The per-session and per-device keyed locks are held by the handler's promise (request-execution-locks.ts, keyed-lock.ts).
  • On abort, the runner fetch rejects at once, the exchange marks the charge abandoned and rethrows (runner-exchange.ts), and the handler settles. The lock is released.
  • The runner never sees the disconnect. Its serial commandExecutionQueue runs the command to completion.
  • Only runner commands queue behind it. A next request whose device work skips the runner, such as a simctl launch from open --relaunch, simctl privacy, or a screenshot, can overtake the tap. So can the runner's inline status and uptime.

Android holds the lock until adb returns, so it is serialized already.

Consumer impact: tester-army/e2e cannot adopt signal. It keeps an inflight set of abandoned commands and waits for each response before the next attempt starts, so that a tap from a canceled step cannot land in the retry (packages/mobile/src/surface.ts). With signal, the client's promise rejects immediately, so that wait no longer proves the device finished.

Required behavior

  • A canceled request whose runner command was already sent keeps its session and device locks until the runner reports that command terminal (completed or failed in the command journal), or until the command's own deadline expires. The client still rejects at once with request_canceled.
  • A command that never reached the runner, or one the runner refused, releases at once, as it does today.
  • A drain that hits the deadline leaves the charge abandoned, as today, so the detach/handoff rules keep seeing it.

Done when

  • A test shows that a canceled runner command holds the session lock until the runner journal reports it terminal, and that a second request on the session starts only after that.
  • Live on an iOS simulator: abort a long press (or longpress --duration) through the client, then immediately run open --relaunch. The launch starts after the press finishes, as the request log shows.

Related: #3178 (per-call signal), #2965 (charge settlement by terminal evidence).

主要语言
TypeScript
星标
4.9k
派生
328
平均合并
11 小时 48 分钟
30 天内合并 PR
605

环境准备

  • 没有 Dockerfile 或 Docker Compose 文件
  • 没有 Pull Request 模板
  • 阅读贡献指南

从这里开始

  1. 先读完整个 Issue,再读项目的贡献指南。
  2. 在 Issue 下留言说明你要接手 —— 这能避免两个人做同样的事。
  3. Fork 仓库,在一个分支上完成修改。
  4. 提交 Pull Request,并在描述里引用这个 Issue 编号。

callstack/agent-device 的其他 Issue

查看 callstack/agent-device 的全部 Issue

相似的 Issue

更多 TypeScript Issue

把新 issue 发到你的邮箱

精选适合新手参与的 GitHub issue 摘要。