[MS-932] Improve CoSync analytics part 1 - add biometricDataSource to Callout event#1217
Conversation
4496d9e to
3f6082e
Compare
3f6082e to
bd9e980
Compare
There was a problem hiding this comment.
Pull Request Overview
This PR introduces V3 versions of callout events and payloads to include biometricDataSource, while retaining V2 types for legacy support. It updates the serialization, domain-to-API mappings, and test factories to use the new request types.
- Add new
Api*V3callout models and payloads withbiometricDataSource - Rename existing callout classes to
*V2and update mappings inApiEventPayloadTypeandApiEventPayload - Extend
ActionFactoryand update tests to useIdentifyActionRequest,VerifyActionRequest,EnrolLastBiometricActionRequest, andConfirmIdentityActionRequest
Reviewed Changes
Copilot reviewed 60 out of 60 changed files in this pull request and generated 1 comment.
Show a summary per file
| File | Description |
|---|---|
| infra/event-sync/src/main/java/.../ApiEnrolmentLastBiometricsCalloutV3.kt | New V3 model for last biometrics callout |
| infra/event-sync/src/main/java/.../ApiEnrolmentLastBiometricsCalloutV2.kt | Renamed old callout to V2 |
| infra/event-sync/src/main/java/.../ApiEnrolmentCalloutV3.kt | New V3 enrolment callout model |
| infra/event-sync/src/main/java/.../ApiEnrolmentCalloutV2.kt | Renamed old enrolment callout to V2 |
| infra/event-sync/src/main/java/.../ApiConfirmationCalloutV3.kt | New V3 confirmation callout model |
| infra/event-sync/src/main/java/.../ApiConfirmationCalloutV2.kt | Renamed old confirmation callout to V2 |
| infra/event-sync/src/main/java/.../ApiCalloutPayloadV3.kt | New V3 payload constructors including biometricDataSource |
| infra/event-sync/src/main/java/.../ApiCalloutPayloadV2.kt | Updated V2 payload constructors |
| infra/event-sync/src/main/java/.../ApiCalloutIntegrationInfo.kt | Removed unused integration info enum |
| infra/event-sync/src/main/java/.../ApiBiometricDataSource.kt | New enum and mapping for BiometricDataSource |
| infra/event-sync/src/main/java/.../ApiEventPayloadType.kt | Mapped new V3 event types |
| infra/event-sync/src/main/java/.../ApiEventPayload.kt | Updated domain-to-API payload mapping for V2/V3 callouts |
| feature/login-check/src/main/java/.../ReportActionRequestEventsUseCase.kt | Updated to emit V3 events |
| feature/login-check/src/test/java/.../ReportActionRequestEventsUseCaseTest.kt | Tests updated to use ConfirmIdentityActionRequest |
| feature/login-check/src/test/java/.../IsUserSignedInUseCaseTest.kt | Updated test to use IdentifyActionRequest |
| feature/login-check/src/test/java/.../ExtractParametersForAnalyticsUseCaseTest.kt | Updated to use IdentifyActionRequest |
| feature/login-check/src/test/java/.../ExtractCrashKeysUseCaseTest.kt | Updated to use IdentifyActionRequest |
| feature/login-check/src/test/java/.../AddAuthorizationEventUseCaseTest.kt | Updated to use IdentifyActionRequest |
| feature/login-check/src/test/java/.../ActionFactory.kt | Added new factory methods for identify/verify/enrol-last/confirm |
| feature/login-check/src/test/java/.../LoginCheckViewModelTest.kt | Updated calls to getIdentifyRequest and others |
Comments suppressed due to low confidence (3)
feature/login-check/src/test/java/com/simprints/feature/logincheck/usecases/ExtractParametersForAnalyticsUseCaseTest.kt:31
- [nitpick] Test name refers to 'flow actions' but the implementation now uses
getIdentifyRequest. Please update the test name to reflect 'identify actions'.
fun `Logs analytics keys in flow actions`() = runTest {
feature/login-check/src/test/java/com/simprints/feature/logincheck/usecases/ExtractParametersForAnalyticsUseCaseTest.kt:41
- [nitpick] Test name refers to 'follow up actions' but the implementation now uses
getConfirmationRequest. Please update the test name to reflect 'confirmation actions'.
fun `Does not log analytics keys in follow up actions`() = runTest {
feature/login-check/src/test/java/com/simprints/feature/logincheck/LoginCheckViewModelTest.kt:160
- [nitpick] Test name mentions 'flow action' but now invokes
getIdentifyRequest. Rename the test to reflect an 'identify action'.
fun `Triggers login flow if not signed in and flow action`() = runTest {
|
|
||
| coVerify { | ||
| sessionEventRepository.addOrUpdateEvent(withArg { it is EnrolmentCalloutEvent }) | ||
| sessionEventRepository.addOrUpdateEvent(withArg { it is EnrolmentCalloutEventV3 }) |
There was a problem hiding this comment.
In the confirmation action test you assert that an EnrolmentCalloutEventV3 is emitted, but the implementation should only emit a ConfirmationCalloutEventV3. Please remove or correct this assertion.
| sessionEventRepository.addOrUpdateEvent(withArg { it is EnrolmentCalloutEventV3 }) |
|


JIRA ticket
Will be released in: 2025.2.0
Notable changes
biometricDataSourceinEnrolmentCalloutEvent,IdentificationCalloutEvent,VerificationCalloutEvent. For consistency V3 versions ofEnrolmentLastBiometricsEventandConfirmationCalloutEventhave been created although they don't differ from V2 versionsbiometricDataSource) and any newly added Callout events from 2025.2.0 on to be V3 withbiometricDataSource. This will create consistency in the backend data where ifbiometricDataSourceis not null we can be sure it was the real value for the session and not a default one set during migration.Testing guidance
biometricDataSource)biometricDataSourceand new ones with correct non-null data)Additional work checklist