Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

chore(suite-native): prepare one place for all global hooks #16444

Merged
merged 3 commits into from
Jan 17, 2025

Conversation

matejkriz
Copy link
Member

@matejkriz matejkriz commented Jan 17, 2025

Description

We have multiple hooks that is supposed to be global and available everywhere, this is defining one place for those hooks.

We apparently have incorrectly placed hooks in the AuthorizeDeviceStackNavigator, namely useReportDeviceConnectToAnalytics and useDetectDeviceError. The AuthorizeDeviceStackNavigator only mounts when connecting a Trezor that hasn't been remembered (view-only on). If the Trezor with view-only enabled was connected, it did not mount, and those hooks remained inactive.

Notes for @trezor/qa
The only change that this PR is supposed to cause is that if you connect Trezor, that has view-only already enabled and have some error, it should show the alert. Previously it was ignored. So it can theoretically cause more Unacquired errors.

It makes sense to test connecting Trezor to the app in different scenarios (view-only enabled/disabled, welcome flow finished/fresh app, open app by connecting the Trezor...)

Followup to move and fix reporting of device connected to analytics #16446

Screenshots

Trezor connected at the first screen of Welcome flow, warning visible only after Welcome flow:
https://github.com/user-attachments/assets/f3a2f7f4-1494-484b-b44c-ed5f597f30c0

Copy link

github-actions bot commented Jan 17, 2025

🚀 Expo preview is ready!

  • Project → trezor-suite-preview
  • Platforms → android, ios
  • Scheme → trezorsuitelite
  • Runtime Version → 22
  • More info

Learn more about 𝝠 Expo Github Action

…bal to global hook

- Handle device errors even if the device is already remembered.
@matejkriz matejkriz force-pushed the feat/native/global-hooks branch from a221e0b to a063985 Compare January 17, 2025 14:49
@matejkriz matejkriz marked this pull request as ready for review January 17, 2025 14:59
@matejkriz matejkriz requested a review from a team as a code owner January 17, 2025 14:59
@matejkriz matejkriz merged commit 49038bf into develop Jan 17, 2025
17 checks passed
@matejkriz matejkriz deleted the feat/native/global-hooks branch January 17, 2025 15:30
@matejkriz
Copy link
Member Author

I guess this PR caused this issue #16494

@STew790
Copy link
Contributor

STew790 commented Jan 23, 2025

QA OK
Connected/disconnected multiple devices multiple times and all seems OK. This issue was fixed #16494 .

Info
25.1.2 b6893f7

@STew790 STew790 added the QA OK Issue passed QA without any blocker label Jan 23, 2025
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
QA OK Issue passed QA without any blocker
Projects
Status: ✅ Approved
Development

Successfully merging this pull request may close these issues.

5 participants