digitalfabrik / entitlementcard

App for 'Digitale Berechtigungskarten', generally benefit card for volunteers or socially vulnerable groups in Germany. App for Android & iOS + Backend + Administration Web Portal – 100% Open Source.
MIT License
36 stars 3 forks source link

Report error to sentry if initialization of userCodeModel fails #1651

Closed michael-markl closed 1 month ago

michael-markl commented 1 month ago

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

michael-markl commented 1 month ago

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.

michael-markl commented 1 month ago

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

Done! https://github.com/digitalfabrik/entitlementcard/issues/1656