-
-
Notifications
You must be signed in to change notification settings - Fork 251
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(connect): Device cancelable prompts (pin, word, passphrase) #13925
Conversation
const getAddressCall = getAddress(true); | ||
await new Promise(resolve => { | ||
TrezorConnect.on('UI_EVENT', event => { | ||
if (event.type === 'ui-request_passphrase') { |
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.
- add ui-response with nullable value (effectivelly cancels)
}); | ||
|
||
test('Synchronous Cancel', async () => { | ||
await setupTest({ |
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.
maybe automatic button rensposes
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 is a deeper rabbit hole, briefly there are 2 problems:
- core
methodSynchronize
is async (loading method) and it is resolved in the next tick, before method is assigned there is nothing to cancel - even if here wouldnt be race condition mentioned above there is no possibility to stop current "acquire" process from the outside, therefore it continues, device gets acquired and workflow continues
since it's not related to my current changes i'm leavaing this for later with todo's and comments
f37c59b
to
28dac78
Compare
21d6067
to
71b9973
Compare
d3f4805
to
5410bfe
Compare
73e4030
to
f2827d7
Compare
f2827d7
to
2fc7c5c
Compare
/rebase |
Start rebasing: https://github.com/trezor/trezor-suite/actions/runs/10992660973 |
2fc7c5c
to
c00be60
Compare
c00be60
to
ba4aba6
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 and should be fixing stuff. Also it doesn't seem to be conflicting with @marekrjpolak's views of life (or at least I hope it doesn't).
I created #14507 to let QA know what should be tested. I'd say we may merge it now so that it receives proper testing long enough before the freeze that is scheduled in a week or so.
/rebase |
Start rebasing: https://github.com/trezor/trezor-suite/actions/runs/11015634972 |
ba4aba6
to
73c604b
Compare
It seems to fail for some popup tests. I will investigate it tomorrow |
There is indeed one difference in behaviour caught by tests develop this branch it doesn't kill the method upon disconnection of the device, it lets the permissions screen active and when I approve it, only after that I would see this error screen |
/rebase |
Start rebasing: https://github.com/trezor/trezor-suite/actions/runs/11036794841 |
73c604b
to
635fb5c
Compare
- parametrize karma singleRun - remove unused (mocha, browserConsoleLogOptions) from karma config - karma fallback for `it.skip` and `it.only` - fix import in fixtures - fix filter and accept `testName.test` pattern
635fb5c
to
07438f6
Compare
delete this.runPromise; | ||
this.transportSession = null; // set to null to prevent transport.release and cancelableAction | ||
|
||
return this.interruptionFromUser(ERRORS.TypedError('Device_Disconnected')); |
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 was the reason of failing tests
interruptionFromUser
was not awaited and in the same time runPromise
was deleted therefore if couldn't be rejected by interruptionFromUser
Description
Fix unreported (?) behavior: calling
Cancel
on device when promptPin, promptPassphrase, promptWord is rejected orTrezorConnect.cancel
was invoked.Changes:
Device
Device
Lets test and discuss :)
resolve #14507 (maybe it won't resolve everything, I just want to trigger QA :P)