web
web copied to clipboard
Gracefully handle not completing the KeepKey initialization flow
Overview
The user can select the close or back buttons to exit the initialization flow, possibly by accident. This will drop them into a broken state until they choose to disconnect their wallet. This may be a non-obvious fix, especially if the user got into the state accidentally.
References and additional details
We'll want to update the onClose()
model handler (and any other relevant handlers) to ensure the app is left in a happy state.
Acceptance Criteria
If a user disconnects their KeepKey close the modal and kick them back to the connect wallet flow. Also, send the user to the wallet connection screen if they ever close (x) out of the recovery modal.
Product to confirm.
Need By Date
No response
Screenshots/Mockups
No response
Estimated effort
No response
If a user disconnects their KeepKey close the modal and kick them back to the connect wallet flow. Also, send the user to the wallet connection screen if they ever close (x) out of the recovery modal.
@0xApotheosis I implemented the unplug behavior inside https://github.com/shapeshift/web/pull/1653
For the click on the closing cross, the fact that the onClose
behavior is common to every wallets flows is blocking because we would need to override it for the KeepKey flow, I would need to talk about it with you in order to find the best solution
I also found a strange behavior/bug, if you enter the wallet name on both flows (recovery and initialize), you'll end to the pin view, then if you go back, you are asked to enter the wallet name again but the view is blocked after submitting it because both wallet.reset
and wallet.recover
throws an error ActionCancelled
without any error code
As these methods throws, we don't receive the PINMATRIXREQUEST
message, we end up being blocked on the Label
view with the keepkey on the Enter new pin
state...
If you don't mind, I would love to talk about everything I said with you and implement the fix inside the existing PR, because it's pretty linked
@0xApotheosis I implemented the unplug behavior inside https://github.com/shapeshift/web/pull/1653
I've updated the PR to indicate that the PR only partially addresses this issue. Then we'll leave this issue open so that the delta can be tracked.
For the click on the closing cross, the fact that the onClose behavior is common to every wallets flows is blocking because we would need to override it for the KeepKey flow, I would need to talk about it with you in order to find the best solution
I've often thought we should add the ability to pass an optional onClose
function as a prop to override the default behavior. Is this something you'd be comfortable writing an issue for, and then implementing?
I also found a strange behavior/bug, if you enter the wallet name on both flows (recovery and initialize), you'll end to the pin view, then if you go back, you are asked to enter the wallet name again but the view is blocked after submitting it because both wallet.reset and wallet.recover throws an error ActionCancelled without any error code
I've been able to replicate that, too. Could you please write a new issue outlining the bug to give the KeepKey team visibility of this? We won't tackle it, though.
I created the issue.
About the onClose
override, it applied inside the WalletViewsSwitch.tsx
file on the modal directly, there are 2 way to make it overridable:
- Never pass the cross component there but add the cross icon inside every modal component, so you can override the onClose event
- Add the possibility to pass a method as a
location.state
to override it (could be buggy and pretty dirty)
If you have a better way, just tell me
Brilliant - linking here for posterity: https://github.com/shapeshift/web/issues/1662
For the onClose
override, let's leave it for now and implement it when we need to 👍
@pastaghost is this still an open bounty??? and if so, can it be bountied to @brymut as the other bounty hunter has made no progress on it ?