-
-
Notifications
You must be signed in to change notification settings - Fork 272
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
Conversation
Regarding the error UX this is what I have for now, which I feel is good enough. 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. |
Yes, this is good enough. Thanks! |
dcf884d
to
de48672
Compare
de48672
to
326e19e
Compare
There was a problem hiding this 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.`, |
There was a problem hiding this comment.
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
There was a problem hiding this comment.
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
packages/connect/src/core/index.ts
Outdated
@@ -428,6 +428,8 @@ const inner = async (context: CoreContext, method: AbstractMethod<any>, device: | |||
sendCoreMessage(createPopupMessage(POPUP.CANCEL_POPUP_REQUEST)); | |||
} | |||
|
|||
method.checkDeviceCapability(); |
There was a problem hiding this comment.
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?
326e19e
to
5b6d4c2
Compare
maybe put it ahead of permissions check? c4f0ef9 |
Sure, looks like it belongs with the earlier checks |
/rebase |
c4f0ef9
to
9c1cf66
Compare
very dirty draft, discussion is going on in https://satoshilabs.slack.com/archives/C02V2PSDNA2/p1729692326462089?thread_ts=1729676861.081469&cid=C02V2PSDNA2
resolve #15032