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

Report error to sentry if initialization of userCodeModel fails #1651

Merged
merged 2 commits into from
Oct 3, 2024

Conversation

michael-markl
Copy link
Member

@michael-markl michael-markl commented Sep 26, 2024

Short description

Report errors to sentry if initialization of UserCodeModel fails, instead of silently swallowing potentially thrown exceptions.

Also, if initialization fails, do not implicitly use empty array of user codes, but show error.

Also throw Errors when using UserCodeModel when it is not properly initialized.

Side effects

If the initialization actually failed, the "Ausweisen" tab displays an error message now.

Testing

Activating card via Scanner and via Deeplink still works.
Activated cards survive app restart.

Resolved issues

Fixes: #1297

Related: #1265

Copy link
Contributor

@f1sh1918 f1sh1918 left a comment

Choose a reason for hiding this comment

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

Nice refactoring, tested on android and ios!

frontend/lib/identification/identification_page.dart Outdated Show resolved Hide resolved
@michael-markl
Copy link
Member Author

I noticed that the initialization is not awaited in the DeepLink activation workflow. So I did this now. I then noticed that the deeplink activation workflow lacks user feedback. I added a loading spinner and some barebones error feedback. The error handling should be improved in the future.

Copy link
Contributor

@f1sh1918 f1sh1918 left a comment

Choose a reason for hiding this comment

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

Thx for the fix! Works fine on android and ios

Could you please create an issue for the error handling improvement and add the particular issue id to the todo. thx

Also, if initialization fails, do not implicitly use empty array of user codes, but show error.

Also throw Errors when using UserCodeModel when it is not properly initialized.

Also add a loading spinner and some error popup to deeplink activation.
@michael-markl
Copy link
Member Author

Could you please create an issue for the error handling improvement and add the particular issue id to the todo. thx

Done! #1656

Copy link
Member

@ztefanie ztefanie left a comment

Choose a reason for hiding this comment

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

Thanks for this PR, only one small suggestion. Not tested

frontend/lib/identification/user_code_model.dart Outdated Show resolved Hide resolved
@michael-markl michael-markl enabled auto-merge (rebase) October 3, 2024 12:04
@michael-markl michael-markl merged commit 05c572e into main Oct 3, 2024
1 check passed
@michael-markl michael-markl deleted the report-initialization-error branch October 3, 2024 12:07
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

Refactor importLegacyCard
3 participants