Skip to content
Open
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
Original file line number Diff line number Diff line change
Expand Up @@ -118,7 +118,7 @@ const CONFIRM_ACTION_STEP_DELAY_MS = 1000;
const POST_SEQUENCE_SETTLE_MS = 3000;
/** Extra settle time between device preparation (import/create) and the first SDK call. */
const PRE_SDK_SETTLE_MS = 3000;
const SDK_CASE_DELAY_MS = 80;
const SDK_CASE_DELAY_MS = 300;
const DEVICE_FLOW_ONLY_SUITES: TestSuiteType[] = ['deviceFlow'];
type DeviceUiAction = 'confirm' | 'slide';

Expand Down Expand Up @@ -1463,10 +1463,16 @@ export function useAutomationTest() {
featuresAfter = await fetchDeviceFeatures(sdk, connectId);
}

const forceUseEmptyPassphrase = featuresAfter?.passphrase_protection === true;
// Treat an unknown state (features fetch failed) as still-enabled: forcing
// 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;

Copy link
Copy Markdown
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

当 Single Security Check 复用已准备好的设备,且这次 getFeatures 暂时失败时,featuresAfterPreparation 会是 undefined;复用分支仍使用 === true,因此会把未知状态当成 passphrase 已关闭,绕过这里新增的保守兜底。

如果设备实际仍开启 passphrase,后续主钱包调用不会携带 useEmptyPassphrase,会再次批量报 DeviceOpenedPassphrase。请让复用分支也采用 passphrase_protection !== false,或统一复用同一个状态判定函数。

if (forceUseEmptyPassphrase) {
addLog(
`[${suiteLabel}] passphrase_protection is still enabled; forcing useEmptyPassphrase for main-wallet SDK calls`
`[${suiteLabel}] passphrase_protection is ${
featuresAfter ? 'still enabled' : 'unknown'
}; forcing useEmptyPassphrase for main-wallet SDK calls`
);
}

Expand Down
Loading