fix(automation): harden main-wallet passphrase guard and slow SDK case pacing#838
Open
wabicai wants to merge 1 commit into
Open
fix(automation): harden main-wallet passphrase guard and slow SDK case pacing#838wabicai wants to merge 1 commit into
wabicai wants to merge 1 commit into
Conversation
originalix
reviewed
Jul 16, 2026
| // useEmptyPassphrase on a passphrase-off device is a harmless no-op, while | ||
| // skipping it on a passphrase-on device fails every main-wallet call with | ||
| // DeviceOpenedPassphrase (a prior deviceFlow suite leaves passphrase on). | ||
| const forceUseEmptyPassphrase = featuresAfter?.passphrase_protection !== false; |
Contributor
There was a problem hiding this comment.
当 Single Security Check 复用已准备好的设备,且这次 getFeatures 暂时失败时,featuresAfterPreparation 会是 undefined;复用分支仍使用 === true,因此会把未知状态当成 passphrase 已关闭,绕过这里新增的保守兜底。
如果设备实际仍开启 passphrase,后续主钱包调用不会携带 useEmptyPassphrase,会再次批量报 DeviceOpenedPassphrase。请让复用分支也采用 passphrase_protection !== false,或统一复用同一个状态判定函数。
…e pacing - prepareStandaloneMainWallet: treat an unknown passphrase_protection state (features fetch failed) as still-enabled so main-wallet calls always carry useEmptyPassphrase — previously a transient getFeatures failure left calls bare and every securityCheck/chainMethodBatch case failed with "Device opened passphrase" after a deviceFlow suite left passphrase on - raise SDK_CASE_DELAY_MS 80ms -> 300ms Co-Authored-By: Claude Fable 5 <noreply@anthropic.com>
wabicai
force-pushed
the
chore/automation-sdk-case-delay
branch
from
July 17, 2026 04:39
2f5ada2 to
7121752
Compare
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.
Summary
Two robustness fixes for the hardware automation test suite (runs against PhonePilot):
prepareStandaloneMainWallet: treat an unknownpassphrase_protectionstate as still-enabled. The guard usedfeaturesAfter?.passphrase_protection === true, so a transientgetFeaturesfailure (undefined) skippeduseEmptyPassphraseon all main-wallet calls. When a preceding deviceFlow suite left the device with passphrase enabled, every securityCheck/chainMethodBatch case then failed withfailure(Device opened passphrase)(observed on the "BIP39 导入 / API 专用助记词" scenario). ForcinguseEmptyPassphraseon a passphrase-off device is a harmless no-op, so unknown now defaults to forcing it; the log line distinguishesstill enabledfromunknown.SDK_CASE_DELAY_MS80ms → 300ms to reduce flakiness between consecutive SDK cases.Counterpart PhonePilot changes (OCR calibration + sequence timing): OneKeyHQ/qa-auto-hardware#32. All PhonePilot sequence IDs referenced here (
/healthdrift check) are unchanged.🤖 Generated with Claude Code