Repository navigation
feat(daemon): an action that unlocked the phone first says so - #135
Merged
Merged
Conversation
With auto-unlock on, the first action after the phone locked itself unlocked it first: about 14 s on an iPad through WDA (a digit and a check per second), about 5 s natively. The answer said nothing about it, so the action just looked slow (the first action after switching devices, it seemed, since the device switched to had sat idle and locked meanwhile). The answer now says it on its first line, with how long it took: `已按 home(手机锁着,先自动解锁了,用时 14.1 秒)`; also a screenshot's caption and an error after the unlock. The event log gets a line too. Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
…s on the iPhone Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
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
In the 0.2.7 regression the first action after switching devices was slow (18 s on the iPad, 9–10 s on the iPhone, against 3 s and 0.5 s). It wasn't the switch: with debug logs on, the time went to auto-unlock. The device had sat idle while the other one was tested and locked itself, so the first action unlocked it first. On the iPad: Home to wake, swipe up for the keypad, then six digits each tapped and checked (about 1 s each); natively on the iPhone: 1.5 s for the lock screen to read after closing HID, then about 0.7 s a digit. Without switching, 3 minutes idle on the iPad gave the same 18 s.
The unlock is meant to be there, and checking each digit is the safety rule (one wrong passcode disables auto-unlock), so it stays as it is. But nothing said it happened:
Daemon::ensure_unlockeddroppedOutcome::Unlocked, so the answer and the event log were silent, and an agent (or a person reading a regression run) saw an unexplained 10–20 s.ensure_unlockedrecords how long an unlock took (PerDevice::unlocked) and writes已自动解锁(用时 X 秒)to the event log.dispatchadds it to the answer's first line, like the other notes about what was done:没找到包含 "…" 的元素,…(手机锁着,先自动解锁了,用时 8.7 秒). A screenshot gets it in its caption, an error after the unlock in its message. No unlock, no change.Tests
1. Unit tests
cargo test -p ictl-daemon --all-features --locked(113 passed),cargo clippy -p ictl-daemon --all-features --locked --tests -- -D warnings(with the two lints the local 1.89 toolchain adds, see CONTRIBUTING) andcargo fmt -p ictl-daemon --checkpass in the Rust 1.89 container. Onlyictl-daemonchanged; CI runs the workspace.an_unlock_first_is_said_on_the_answers_first_line(text withthen=elements, image caption, error, nothing unlocked)#[ignore]tests: none apply2. Real-device regression
Linux (Debian 12), this branch (a37a0fc) deployed:
run.py:--- 14 calls, 0 failed, 19.7s in allrun.py:--- 14 calls, 0 failed, 16.6s in all3. Regression cases
4. Real-device proof
Same steps on both builds and devices: lock →
iphone_tap_elementon a missing text → lock →iphone_screenshot→ Home.main(fd759c0)没找到包含 "不存在的按钮xyz" 的元素,先用 iphone_list_elements 或截图看看屏幕…截图看看屏幕(手机锁着,先自动解锁了,用时 8.7 秒)430x932 点,图像像素即点坐标(经 HID)…(经 HID)(手机锁着,先自动解锁了,用时 8.5 秒)…(手机锁着,先自动解锁了,用时 15.1 秒)1024x768 点,图像像素即点坐标(经 WDA)…(经 WDA)(手机锁着,先自动解锁了,用时 13.6 秒)已自动解锁(用时 8.7 秒),(用时 8.5 秒),(用时 15.1 秒),(用时 13.6 秒)Checklist
🤖 Generated with Claude Code