Skip to content
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

Improve error handling in firmware revision check #14626

Merged
merged 2 commits into from
Sep 30, 2024

Conversation

komret
Copy link
Contributor

@komret komret commented Sep 30, 2024

Description

Previously, whenever there was an error while downloading and reading the remote releases.json file, the user would be instructed to go online. This message is misleading when there is some other cause for an error such as incorrect URL or incorrectly formatted JSON file.

It would be nice to log these types of errors to Sentry, but then we'd have to store the stack trace somewhere temporarily before firing the event... maybe next step.

Copy could be improved and the KB article updated.

QA: This cannot be tested without some code modification. But you can test that I did not break the original flow.

Related Issue

Resolve

Screenshots:

Screenshot 2024-09-30 at 14 35 12

@komret komret added the bug Something isn't working as expected label Sep 30, 2024
@@ -59,6 +59,7 @@ export const checkFirmwareRevision = async ({
deviceRevision,
expectedRevision,
}: CheckFirmwareRevisionParams): Promise<FirmwareRevisionCheckResult> => {
console.log(expectedRevision);
Copy link
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

forgotten log?

Copy link
Contributor Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

fixed

@komret komret force-pushed the fix/revision-check-error branch from ae23c46 to feac8db Compare September 30, 2024 12:59
@komret
Copy link
Contributor Author

komret commented Sep 30, 2024

Here's an example of a poorly formatted JSON which cannot be parsed and causes an error:. I'll fix it in another PR.

Copy link
Contributor

@peter-sanderson peter-sanderson left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

However I would like to see what errors are causing this and somehow fix them. Json file error or incorrect URl should not happen

@komret komret mentioned this pull request Sep 30, 2024
@komret
Copy link
Contributor Author

komret commented Sep 30, 2024

/rebase

Copy link

@trezor-ci trezor-ci force-pushed the fix/revision-check-error branch from b81ec4f to fb63794 Compare September 30, 2024 15:24
@komret komret merged commit 8d5b560 into develop Sep 30, 2024
84 checks passed
@komret komret deleted the fix/revision-check-error branch September 30, 2024 16:06
@mroz22
Copy link
Contributor

mroz22 commented Oct 1, 2024

commits organized nicely 👏

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
bug Something isn't working as expected
Projects
Archived in project
Development

Successfully merging this pull request may close these issues.

3 participants