-
-
Notifications
You must be signed in to change notification settings - Fork 276
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: solve hash check on install false positives #15772
Conversation
🚀 Expo preview is ready!
|
@@ -86,6 +87,17 @@ export const prepareFirmwareReducer = createReducerWithExtraDeps(initialState, ( | |||
state.cachedDevice = payload; | |||
}) | |||
.addCase(deviceActions.addButtonRequest, extra.reducers.addButtonRequestFirmware) | |||
.addCase(deviceActions.connectDevice, (state, { payload: { device } }) => { |
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.
💭 Similar condition in deviceReducer, but this is simpler because we don't care about unacquired devices. Then it's just one action we need to match, so we can use the simpler addCase
instead of addMatcher
e5cb614
to
509ff96
Compare
@@ -311,6 +311,8 @@ const storageMiddleware = (api: MiddlewareAPI<Dispatch, AppState>) => { | |||
case FORM_DRAFT.REMOVE_DRAFT: | |||
storageActions.removeFormDraft(action.key); | |||
break; | |||
|
|||
case deviceActions.connectDevice.type: // so that firmwareReducer.addCase for the same action is persisted |
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 works because next(action)
is called at beginning.
So the firmwareReducer.addCase
does its thing first, and only then this case
block is executed to persist the newly updated state.firmware.firmwareHashInvalid
.
@@ -164,7 +161,6 @@ export const firmwareUpdate = createThunk< | |||
// device failed to respond to the hash check, consider the firmware counterfeit |
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.
Please edit the comment, too.
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.
/rebase |
Start rebasing: https://github.com/trezor/trezor-suite/actions/runs/12182760808 |
b051dd0
to
726fed6
Compare
QA OK webUSB
Info:
dev app
Info:
|
QA OK APP
WEB
Info:
|
Description
Checkout testing branch to simulate hash mismatch, or other error (separate commits for each)
Related issue
😞 Reopens #5868
Screenshots
hash mismatch is exonerated.webm