Android: durable flush evidence so a daemon restart inside the test-IME flush window cannot release adb emu kill
メンテナーはふだん 1 日以内に返信
まだ誰も着手していません。
評価
- 難易度
- 5/5
- 見積もり時間
- 1週間以上
- 初心者へのやさしさ
- 15/100
- issue の種類
- バグ
- 明瞭さ
- おおむね明確
- 活発さ
- 活発
- 技術スタック
- android, typescript
- 領域
- cli, mobile-dev
調査の方向性
Start in packages/platform-android/src/ime-state.ts (testImeLastRestoreAtPerfMs and its restart-boundary comment) and ime-recovery-marker.ts (the {version: 1, serial} marker), then read shutdown/runtime.ts and its test file. The design choice comes first: epoch deadline with a skew rule, a boot-token form, or a device-verified marker. Done means a fresh-process kill-bound close waits out the persisted window, expired evidence self-removes without blocking, and startup adds no sleep.
索引モデルが issue の本文から書いたものです。
説明
Purpose
A confirmed Android test-IME restore currently owes a ~2.5 s SettingsProvider flush hold (MAX_WRITE_SETTINGS_DELAY_MILLIS + margin) before any adb emu kill, but the deadline lives only in the daemon's in-process map (testImeLastRestoreAtPerfMs, packages/platform-android/src/ime-state.ts). If the daemon restarts inside the window, the new process has no record of the recent write while the durable recovery marker has already been cleared (the write is confirmed, so the marker has done its job). A kill-bound close --shutdown or standalone shutdown in the new process then waits for nothing and can kill mid-flush: the provider's delayed XML write is lost and the emulator reboots on the test IME — the user-visible outcome of #3318, arriving by the restart route.
PR #3331 landed the entire in-process half (registration beside the confirming write, kill-site choke-point hold, monotonic-clock timing, mid-wait re-read) and explicitly documented this restart boundary in the ime-state.ts map comment. This issue is the cross-restart half.
Required behavior
- After a confirmed
ime setrestore on an emulator, a daemon restart before the flush window elapses must not allowadb emu killto run before the newest write's window has passed — evaluated from evidence that survives process death. - Clock constraint. The deadline cannot be persisted in the current shape: the in-process window is keyed off
performance.now()deliberately (a forward wall-clock step must not shorten it; #3331 has a regression test proving that), andperformance.now()is relative to process start, so the number is meaningless to the next process. Any persisted form must be one of (non-exhaustive):- an epoch-ms deadline plus a documented rule for what host-clock skew can and cannot do to it (bounded, fail-safe toward waiting); or
- a monotonic-safe derivation (e.g. boot-identifying token plus elapsed rule); or
- a durable "flush unconfirmed" marker that a kill-bound path must re-verify against the device rather than a host clock.
State the chosen form and its skew behavior in the implementation.
- Expiry rule is mandatory. Durable flush evidence without an expiry is worse than today's hole: a stale marker could block every future shutdown of a dead/removed AVD forever. Evidence must become inert once the window has provably passed (wall time past deadline ⇒ the provider flush completed long ago ⇒ delete-on-read or equivalent), and a vanished/unkillable device must not strand the shutdown path — decide explicitly whether expiry skips the wait or the kill proceeds with a warning.
- Startup must keep paying zero sleep for the window: restore-time registration stays synchronous; only kill-bound paths consume it (the invariant #3331 encoded and tested).
Observable completion conditions
- Unit/kill-site tests at the level of
packages/platform-android/src/shutdown/runtime.test.ts: a kill-bound close in a "fresh process" (test resets the in-process map but not the durable evidence) waits out the persisted window beforeadb emu kill; the deferred-sleep interleaving discipline already established there applies. - A test showing expired durable evidence does not block a kill and self-removes.
- A test pinning the clock choice against the skew direction it tolerates, mirroring the monotonic-jump test #3331 added.
- No new sleep on daemon startup or ordinary close paths.
Dependencies
- Lands on the mechanism from PR #3331 (registration inside
restoreAndroidTestImeFor, kill-site hold inshutdown/runtime.ts, single marker-clear rule viaisRecoveryMarkerClearEarned). Do not re-implement the in-process window; extend its evidence. - Likely touches the marker format (
ime-recovery-marker.ts, currently{version: 1, serial}) and possibly threads a state-dir file host through the shutdown-runtime contract (todayPick<DeviceShutdownRuntimeDependencies, 'commands'>), which is a contracts change to weigh during design review. - The cheapest acceptable variant — re-register a full window at startup whenever startup recovery clears a marker after a confirmed restore (accepted over-wait, monotonic-safe, no persistence) — closes only the startup-recovery route, not the close-time route; if chosen, say which routes remain open.
Origin: cubic P1 on PR #3331 (thread discussion_r4225418232), confirmed and analyzed there with the monotonic-vs-persist tension spelled out.
- 主要言語
- TypeScript
- スター
- 5.1k
- フォーク
- 339
- 平均マージ
- 12時間 50分
- マージ済み PR(30日)
- 632
環境構築
- Dockerfile・Docker Compose ファイルなし
- プルリクエストのテンプレートなし
- コントリビューションガイドを読む
はじめの一歩
- issue を最後まで読み、次にプロジェクトのコントリビューションガイドを読みます。
- 着手することを issue にコメントします — 二人が同じ作業をするのを防げます。
- リポジトリをフォークし、ブランチを切って変更します。
- issue 番号を参照したプルリクエストを送ります。
callstack/agent-device のほかの issue
-
難易度 2/5 1〜3時間 初心者へのやさしさ 64/100
callstack/agent-device#3945 ·
メンテナーはふだん 1 日以内に返信
-
Limrun iOS fill reports success but drops non-ASCII text対応中かも @mvanhorn が 5 日前に担当しました。 オープンbug ready-for-agent
難易度 2/5 1〜3時間 初心者へのやさしさ 87/100
callstack/agent-device#3819 · コメント 2 件 ·
メンテナーはふだん 1 日以内に返信
-
難易度 2/5 1〜3時間 初心者へのやさしさ 68/100
callstack/agent-device#1869 ·
メンテナーはふだん 1 日以内に返信
-
iOS keyboard capture can race dismissal and omit the input assistant bar対応中かも @shamilovtim が今日担当しました。 オープン
難易度 4/5 3〜5日 初心者へのやさしさ 51/100
callstack/agent-device#3957 ·
メンテナーはふだん 1 日以内に返信
-
iOS fill can report TEXT_ENTRY_MISMATCH before the confirmation deadline対応中かも @shamilovtim が 1 日前に担当しました。 オープン
難易度 3/5 1〜2日 初心者へのやさしさ 35/100
callstack/agent-device#3952 ·
メンテナーはふだん 1 日以内に返信
callstack/agent-device の issue をすべて見る
似ている issue
-
bug
難易度 2/5 1〜3時間 初心者へのやさしさ 68/100
outline/outline#14348 · コメント 1 件 ·
メンテナーはふだん 1 日以内に返信
-
bug needs-triage
難易度 2/5 1〜3時間 初心者へのやさしさ 68/100
メンテナーはふだん 1 日以内に返信
-
[Bug]: Agent import retains quotes in .env API keys followed by inline comments対応中かも @yxr-2025 が今日担当しました。 オープン
難易度 2/5 1〜3時間 初心者へのやさしさ 82/100
elie222/rakazo#2322 · コメント 1 件 ·
メンテナーはふだん 1 日以内に返信
-
bug
難易度 2/5 1〜3時間 初心者へのやさしさ 76/100
awslabs/visual-asset-management-system#804 ·
メンテナーはふだん 1 日以内に返信
-
bug
難易度 2/5 1〜3時間 初心者へのやさしさ 68/100
dsh-market/dsh-market#1027 · コメント 1 件 ·
メンテナーはふだん 1 日以内に返信