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

Untangle card status in app #1071

Merged
merged 1 commit into from
Aug 7, 2023
Merged

Conversation

michael-markl
Copy link
Member

This PR untangles how the app determines the status of a persisted card.
It should be clearer to see what is shown in the "Ausweisen" tab.

The only functional change:

  • We initiate self-verification in any status (previously, we did not self-verify if the card expired (according to local clock) or if it the backend ever responded with invalid).
  • Try to detect race-conditions in self-verification (possibly conflicting with activation): If the UserCode was set while doing the server request, then ignore the result.

Minor change:

  • VerificationCodeView sets its own timer (instead of OTPGenerator setting it), in order to be able to cancel it in case it is being disposed. Previously, we had an error in the console, when the VerificationCodeView was unmounted.

@michael-markl michael-markl changed the title Self-Verify card also if invalid or expired Untangle card status in app Aug 4, 2023
Copy link
Contributor

@sarahsporck sarahsporck left a comment

Choose a reason for hiding this comment

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

Tested on android emulator.


@override
Widget build(BuildContext context) {
final wasCardVerifiedLately = cardWasVerifiedLately(userCode.cardVerification);
final isCardInvalid = !userCode.cardVerification.cardValid;
final CardStatus status = CardStatus.from(userCode);
Copy link
Contributor

Choose a reason for hiding this comment

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

<3 very pretty.

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.

really nice improvement :)
Tested for revoking and change expirationDay in the database (even that won't happen)

@michael-markl michael-markl merged commit d94a640 into main Aug 7, 2023
@michael-markl michael-markl deleted the self-verify-if-expired-or-invalid branch August 7, 2023 10:04
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.

3 participants