-
Notifications
You must be signed in to change notification settings - Fork 149
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
fix: close ledger sheet in request keys flow #6024
Conversation
src/app/features/ledger/generic-flows/request-keys/request-keys-flow.tsx
Outdated
Show resolved
Hide resolved
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.
You can't remove the handler and default to navigating home, that'll break flows in which the user isn't mean to visit home page, e.g. all the RPC flows
The routes for the ledger flows are such that |
ed39244
to
3992286
Compare
b1fb06c
to
277bad1
Compare
@kyranjamie @pete-watters guys could you review/test please |
The code looks OK and I will test now but can you please link a ticket to the PR and add it in the commit message? Otherwise it's not clear what the goal of this PR is |
I did some testing here and it doesn't reintroduce this bug anymore so that's good. I did hit an issue when cancelling a transaction though. If I:
It crashes with :
bug_cancelling.mp4The transaction stays open on the Ledger too. I double checked and that doesn't happen on It's been a while since I checked this though and I can't remember what issue its fixing so if you can link that it would be great. |
277bad1
to
3dd753f
Compare
@pete-watters I checked and on dev this error happens for me too. I feel like we need to make this state uncancellable, wdyt? |
Good idea! Maybe it is supposed to be non-cancellable there but became broken? |
appEvents.publish('ledgerBitcoinTxSigningCancelled', { | ||
unsignedPsbt: unsignedTransaction ? bytesToHex(unsignedTransaction.toPSBT()) : '', | ||
}); |
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.
If the action is cancelled, why do we return anything at all with the action? Do we need this?
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.
we need for abort handler
function signingAbortedHandler(msg: GlobalAppEvents['ledgerBitcoinTxSigningCancelled']) {
if (msg.unsignedPsbt === psbt) {
appEvents.unsubscribe('ledgerBitcoinTxSigningCancelled', signingAbortedHandler);
appEvents.unsubscribe('ledgerBitcoinTxSigned', txSignedHandler);
reject(new Error('User cancelled the signing operation'));
}
}
3dd753f
to
efce52d
Compare
Fixed broken close ledger connect sheet
Task: https://linear.app/leather-io/issue/LEA-2078/fix-ledger-cancel-navigation