Skip to content

Commit

Permalink
Merge pull request #258 from privacybydesign/keyshare-enrollment-erro…
Browse files Browse the repository at this point in the history
…rs-not-handled

Fix: errors related to the keyshare server enrollment not shown to th…
  • Loading branch information
ivard authored Dec 5, 2023
2 parents 7ecf89f + b7fa396 commit 521a28c
Show file tree
Hide file tree
Showing 3 changed files with 30 additions and 0 deletions.
1 change: 1 addition & 0 deletions CHANGELOG.md
Original file line number Diff line number Diff line change
Expand Up @@ -7,6 +7,7 @@ and this project adheres to [Semantic Versioning](https://semver.org/spec/v2.0.0
## Unreleased
### Fixed
- irmagobridge's Stop method is not called on iOS when the app is terminated
- Errors related to the keyshare server enrollment not shown to the user

## [7.5.3] - 2023-11-16
### Changed
Expand Down
5 changes: 5 additions & 0 deletions lib/src/data/irma_client_bridge.dart
Original file line number Diff line number Diff line change
Expand Up @@ -52,7 +52,12 @@ class IrmaClientBridge extends IrmaBridge {
PairingRequiredSessionEvent: (j) => PairingRequiredSessionEvent.fromJson(j),
SuccessSessionEvent: (j) => SuccessSessionEvent.fromJson(j),
CanceledSessionEvent: (j) => CanceledSessionEvent.fromJson(j),

KeyshareEnrollmentMissingSessionEvent: (j) => KeyshareEnrollmentMissingSessionEvent.fromJson(j),
KeyshareEnrollmentDeletedSessionEvent: (j) => KeyshareEnrollmentDeletedSessionEvent.fromJson(j),
KeyshareBlockedSessionEvent: (j) => KeyshareBlockedSessionEvent.fromJson(j),
KeyshareEnrollmentIncompleteSessionEvent: (j) => KeyshareEnrollmentIncompleteSessionEvent.fromJson(j),

ClientReturnURLSetSessionEvent: (j) => ClientReturnURLSetSessionEvent.fromJson(j),
FailureSessionEvent: (j) => FailureSessionEvent.fromJson(j),

Expand Down
24 changes: 24 additions & 0 deletions lib/src/data/session_repository.dart
Original file line number Diff line number Diff line change
Expand Up @@ -70,6 +70,30 @@ class SessionRepository {
status: SessionStatus.error,
error: event.error,
);
} else if (event is KeyshareEnrollmentMissingSessionEvent) {
return prevState.copyWith(
status: SessionStatus.error,
error: SessionError(
errorType: 'keyshareEnrollmentMissing',
info: 'user not activated at the keyshare server of scheme ${event.schemeManagerID}',
),
);
} else if (event is KeyshareEnrollmentIncompleteSessionEvent) {
return prevState.copyWith(
status: SessionStatus.error,
error: SessionError(
errorType: 'keyshareEnrollmentIncomplete',
info: 'user enrollment incomplete at the keyshare server of scheme ${event.schemeManagerID}',
),
);
} else if (event is KeyshareEnrollmentDeletedSessionEvent) {
return prevState.copyWith(
status: SessionStatus.error,
error: SessionError(
errorType: 'keyshareEnrollmentDeleted',
info: 'user deleted at the keyshare server of scheme ${event.schemeManagerID}',
),
);
} else if (event is StatusUpdateSessionEvent) {
return prevState.copyWith(
status: event.status.toSessionStatus(),
Expand Down

0 comments on commit 521a28c

Please sign in to comment.