Skip to content

fix(suite): retry FW revision check if offline - #30822

Open
Lemonexe wants to merge 2 commits into
developfrom
fix/retry-fw-rev-check-offline
Open

fix(suite): retry FW revision check if offline#30822
Lemonexe wants to merge 2 commits into
developfrom
fix/retry-fw-rev-check-offline

Conversation

@Lemonexe

@Lemonexe Lemonexe commented Aug 4, 2026

Copy link
Copy Markdown
Contributor

Description

  • move useRetryFwAuthenticityChecks from mobile to suite-common, parametrize
  • use also in desktop
  • make the polling interval just slightly longer

Related Issue

Resolve #30821

Screenshots:

Before

The banner does not go away by itself. You have to incidentally make a call on Device, like starting discovery or something, so that it reruns FW Authenticity checks.

be4.webm

After

getFeatures are periodically polled when FW revision check is in "offline error", and when you connect to internet, it resolves to a final result.

after.webm

🤖 LLM Test Recommendations

Summary: The change set focuses on firmware authenticity check retry logic, app preloading/initialization, and device connection thunks. Most risk is concentrated in the onboarding authenticity flow. The recommended tests target that flow plus app initialization and device session management. The suite-native files are not exercised by the Playwright E2E suite.

Changed files (8)
  • packages/suite/src/components/suite/Preloader/Preloader.tsx
  • suite-common/firmware-authenticity/src/index.ts
  • suite-common/firmware-authenticity/src/useRetryFwAuthenticityChecks.ts
  • suite-native/app/src/hooks/useGlobalHooks.tsx
  • suite-native/device/src/hooks/useRetryFwAuthenticityChecks.ts
  • suite-native/device/src/index.ts
  • suite-native/device/src/rerunFwAuthenticityChecksCall.ts
  • suite/device/src/deviceThunks.ts

Recommended tests (4)

🔴 High priority (2)
  • suite/e2e/tests/onboarding/authenticity-check.test.ts — Directly exercises the device authenticity check flow during onboarding, which is the primary behavior affected by the firmware-authenticity retry logic changes and device thunks.
  • suite/e2e/tests/onboarding/firmware-check.test.ts — Tests firmware readiness detection during onboarding; firmware checks share infrastructure with authenticity checks and are affected by preloader and device-thunk changes.
🟡 Medium priority (2)
  • suite/e2e/tests/onboarding/initial-run.test.ts — Verifies onboarding state and persistence across reloads; the Preloader component controls the initial app render and onboarding entry point.
  • suite/e2e/tests/suite/multiple-sessions.test.ts — Exercises bridge session acquisition/enumeration and device connection status, which are handled by device thunks. Inferred coverage since the changed file had no static mapping.

⚠️ Changes with no test coverage (4)

  • suite-native/app/src/hooks/useGlobalHooks.tsx
  • suite-native/device/src/hooks/useRetryFwAuthenticityChecks.ts
  • suite-native/device/src/index.ts
  • suite-native/device/src/rerunFwAuthenticityChecksCall.ts

Updated: 2026-08-05T04:48:46.917Z

🔍 Currents Test Results

🔍 Suite web test results: View in Currents

🔍 Suite desktop test results: View in Currents

🔍 Suite native android test results: View in Currents

🔒 Quarantined E2E Tests

Trezor Suite (desktop) — 2 test(s)
Test Type
Quarantine test: "Recovery - dry run,Recovery after partial recovery" 🙋 manual
Quarantine test: "Recovery - dry run,Recovery with device reconnection" 🙋 manual

Updated: 2026-08-05T04:50:22.960Z • 2 test(s) total

Trezor Suite (web) — 3 test(s)
Test Type
Trading - Navigation > Navigate to 🤖 auto
Quarantine test: "TrezorConnect webextension -> Suite Web,second call after popup was closed by user should work" 🙋 manual
Quarantine test: "Recovery T2T1 - dry run,Recovery after partial recovery" 🙋 manual

Updated: 2026-08-05T04:51:28.227Z • 3 test(s) total

🌐 Preview deployments

🌐 Suite Web preview: https://dev.suite.sldev.cz/suite-web/fix/retry-fw-rev-check-offline/web/

import { type TimerId } from '@trezor/type-utils';
import { isArrayMember } from '@trezor/utils';

const REFRESH_INTERVAL = 5_000; // [ms]

Copy link
Copy Markdown
Contributor Author

Choose a reason for hiding this comment

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

5 seconds instead of 3. Just felt too often when I tested it – when you reconnect to internet, there is more stuff happenning that takes time to resolve.

`${DEVICE_MODULE_PREFIX}/rerunFwAuthenticityChecksThunk`,
(_, { getState }) => {
if (selectIsDeviceLocked(getState())) return;
TrezorConnect.getFeatures();

Copy link
Copy Markdown
Contributor Author

Choose a reason for hiding this comment

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

in native we have device-mutex, which is a global singleton outside of redux so rerunFwAuthenticityChecksCall can be a simple pure function.
In Desktop we have only locks – not as sophisticated, and also a redux selector so I am making this a thunk.

@Lemonexe
Lemonexe force-pushed the fix/retry-fw-rev-check-offline branch from 52d3ee4 to a0edc7e Compare August 4, 2026 17:28
@Lemonexe
Lemonexe marked this pull request as ready for review August 4, 2026 17:30
@Lemonexe

Lemonexe commented Aug 5, 2026

Copy link
Copy Markdown
Contributor Author

/rebase

@github-actions

github-actions Bot commented Aug 5, 2026

Copy link
Copy Markdown

@trezor-bot
trezor-bot Bot force-pushed the fix/retry-fw-rev-check-offline branch from a0edc7e to 0924708 Compare August 5, 2026 04:44
@trezor-bot

trezor-bot Bot commented Aug 5, 2026

Copy link
Copy Markdown
Contributor

✅ Previously successful run of [Test] suite-native Android E2E workflow has been found.
⏭️ Skipping tests for this run.
💡 If you are unsure about your latest changes, please rerun the workflow manually. (Use the Re-run all jobs option)

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

Offline FW revision check banner doesn't disappear after going online

1 participant