Repository navigation
fix(daemon): a paste over the same selected text isn't reported as failed - #133
Merged
Merged
Conversation
…iled Natively, a paste is checked by the fields' values changing to hold the text. Spotlight opens with the last search selected, so pasting the same search again replaces it with itself: nothing changes, and `type_text` said the text never went in (and didn't press Return with `submit`), although it had. Once the paste prompt was answered, a field that already held the text and stays unchanged for 1.5 s now counts as typed, with a note to check with a screenshot. Without an answered prompt it still fails, since iOS asks for every paste of ours. `select` no longer says WDA takes 10-60 seconds for a device under native control. Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
Merged
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Add this suggestion to a batch that can be applied as a single commit.This suggestion is invalid because no changes were made to the code.Suggestions cannot be applied while the pull request is closed.Suggestions cannot be applied while viewing a subset of changes.Only one suggestion per line can be applied in a batch.Add this suggestion to a batch that can be applied as a single commit.Applying suggestions on deleted lines is not supported.You must change the existing code in this line in order to create a valid suggestion.Outdated suggestions cannot be applied.This suggestion has been applied or marked resolved.Suggestions cannot be applied from pending reviews.Suggestions cannot be applied on multi-line comments.Suggestions cannot be applied while the pull request is queued to merge.Suggestion cannot be applied right now. Please check back later.
What and why
Found in the 0.2.7 release regression (iPhone 15 Pro Max, iOS 27.2.1, native control). Natively,
iphone_type_textpastes and then checks that a field's value changed and holds the text (native.rs,native_paste). Spotlight opens with the last search selected, so pasting the same search again replaces it with itself: the value doesn't change, and the tool said粘贴了 2 个字符,但 5 秒内输入框里没有这段文字— and withsubmitdidn't press Return — although the text had gone in (the nextwait_forfound the Settings result at once).run.pypasses on a fresh Spotlight and fails from the second run on.paste_seen→Pasted::{Typed, Unchanged, Unreadable, Missing}.PASTE_SAME_SETTLE) counts as typed, with a note:(输入框里原来就是这段文字,粘贴后看不出变化,截图确认). Return is pressed withsubmit.selectsaid "WDA takes 10–60 seconds" for a device under native control; it now says native control is ready in seconds (WDA devices unchanged).The bug is in native control, which ships first in 0.2.7, so there is no changelog line.
Tests
1. Unit tests
cargo test -p ictl-daemon --all-features --locked(112 passed),cargo clippy -p ictl-daemon --all-features --locked --tests -- -D warnings(only the known local-toolchain lints allowed, see CONTRIBUTING) andcargo fmt -p ictl-daemon --checkpass in the Rust 1.89 container. Onlyictl-daemonchanged; CI runs the whole workspace.a_paste_that_replaced_the_same_text_is_told_apart_from_one_that_missed#[ignore]tests of the changed area: none apply2. Real-device regression
Linux (Debian 12), this branch deployed (d939572):
run.pytwice in a row:--- 14 calls, 0 failed, 15.5s in all,--- 14 calls, 0 failed, 16.8s in allmain(ad1c497): first run--- 14 calls, 0 failed, 15.0s in all, second run--- 14 calls, 1 failed, 17.2s in all(thetype_textstep, 5.35 s, ERROR).type_textover the remembered search now takes 3.55–4.27 s (the 1.5 s settle); into an empty field unchanged (2.57 s on main).tasks.pyon the iPhone:--- 70 checks, 0 failed, 38.4s in allrun.py:--- 14 calls, 0 failed, 33.5s in all. The firsttap_elementafter switching devices took 17.7 s; it did the same onmain(18.2 s) in the same situation, so it isn't from this change.3. Regression cases
type_textabove4. Real-device proof
设置from the search before (Home → swipe down →iphone_type_text {"text": "设置"}):main:粘贴了 2 个字符,但 5 秒内输入框里没有这段文字;截图看看:输入框可能没有焦点,或 App 不接受粘贴(field still设置); with a different text (时钟) it passed, so the paste itself works.已输入 2 个字符(已替你点了「允许粘贴」)(输入框里原来就是这段文字,粘贴后看不出变化,截图确认); withsubmit: truealso,并按了回车, and Settings opened.selectto the iPhone:…状态:就绪;原生控制几秒就绪,…; to the iPad:…WDA 起来要 10~60 秒,….Checklist
🤖 Generated with Claude Code