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

feat(connect): display descriptive info when firmware cant serve current method #15034

Merged
merged 1 commit into from
Nov 4, 2024

Conversation

mroz22
Copy link
Contributor

@mroz22 mroz22 commented Oct 23, 2024

@Hannsek
Copy link
Contributor

Hannsek commented Nov 1, 2024

What about these alternatives:
image

@martykan
Copy link
Member

martykan commented Nov 1, 2024

Regarding the error UX this is what I have for now, which I feel is good enough.
Learn more leads you to https://trezor.io/learn/a/bitcoin-only-firmware-on-trezor

Screenshot 2024-11-01 at 11 45 31

To implement a direct link to FW install in Suite would have some caveats, such as if we want to open desktop/web Suite, if desktop we need to add a deeplink.

@Hannsek
Copy link
Contributor

Hannsek commented Nov 1, 2024

Yes, this is good enough. Thanks!

@martykan martykan force-pushed the connect-wrong-firmware-error branch 3 times, most recently from dcf884d to de48672 Compare November 1, 2024 13:41
@martykan martykan changed the title wip(connect): display descriptive info when firmware cant serve curre… feat(connect): display descriptive info when firmware cant serve current method Nov 1, 2024
@martykan martykan force-pushed the connect-wrong-firmware-error branch from de48672 to 326e19e Compare November 1, 2024 15:28
@martykan martykan marked this pull request as ready for review November 1, 2024 15:56
Copy link
Contributor Author

@mroz22 mroz22 left a comment

Choose a reason for hiding this comment

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

looks good to me, left two comments, don't have the right to aprove

if (this.device.firmwareType === 'bitcoin-only') {
throw ERRORS.TypedError(
'Device_MissingCapabilityBtcOnly',
`Trezor has Bitcoin-only firmware installed, which does not support the ${this.info} method. Please install Universal firmware through Trezor Suite.`,
Copy link
Contributor Author

Choose a reason for hiding this comment

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

this.info may sometimes yield quite variable results 🤔 just thinking whether it is a good idea to intertwine it together here

Copy link
Member

Choose a reason for hiding this comment

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

Yeah we could just write "does not support this method" or maybe "does not support this operation", since method may sound strange for less technical people

@@ -428,6 +428,8 @@ const inner = async (context: CoreContext, method: AbstractMethod<any>, device:
sendCoreMessage(createPopupMessage(POPUP.CANCEL_POPUP_REQUEST));
}

method.checkDeviceCapability();
Copy link
Contributor Author

Choose a reason for hiding this comment

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

I am just thinking what is the line to place this check. There are other similar checks, for example this one https://github.com/trezor/trezor-suite/blob/develop/packages/connect/src/core/index.ts#L214
maybe @marekrjpolak has a stronger opinion?

@martykan martykan force-pushed the connect-wrong-firmware-error branch from 326e19e to 5b6d4c2 Compare November 4, 2024 09:31
@mroz22
Copy link
Contributor Author

mroz22 commented Nov 4, 2024

maybe put it ahead of permissions check? c4f0ef9

@martykan
Copy link
Member

martykan commented Nov 4, 2024

Sure, looks like it belongs with the earlier checks

@mroz22
Copy link
Contributor Author

mroz22 commented Nov 4, 2024

/rebase

Copy link

github-actions bot commented Nov 4, 2024

@trezor-ci trezor-ci force-pushed the connect-wrong-firmware-error branch from c4f0ef9 to 9c1cf66 Compare November 4, 2024 14:11
@mroz22 mroz22 merged commit d2c8870 into develop Nov 4, 2024
54 checks passed
@mroz22 mroz22 deleted the connect-wrong-firmware-error branch November 4, 2024 16:23
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.

Unknown message error with Ethereum and Bitcoin-only firmware
3 participants