Skip to content

Commit

Permalink
chore: [IOPID-2538] Fix LOGIN_CIEID_SELECTED event delay (#6483)
Browse files Browse the repository at this point in the history
## Short description
This PR removes the delay in sending some login method selection events.
>[!Note]
>This fix resolves the current behavior where the `LOGIN_CIEID_SELECTED`
event is sent after `LOGIN_CIEID_APP_NOT_FOUND`, even though the latter
occurs later in the flow

## List of changes proposed in this pull request
- Moved the `updateMixpanelProfileProperties` async action after
`mixpanelTrack` to ensure the event order accurately reflects the
intended flow

## Demo
### Before

https://github.com/user-attachments/assets/a2cf58de-0fdb-45a7-a7cc-347a5f9929fc

### After

https://github.com/user-attachments/assets/a6449720-d40d-451c-9936-4dd754f53091

## How to test
Run the app and emulate what shown in the demo videos to ensure that the
event dispatch order is respected.

---------

Co-authored-by: Alice Di Rico <[email protected]>
  • Loading branch information
ChrisMattew and Ladirico authored Dec 4, 2024
1 parent 25bb1c1 commit fcca9d5
Show file tree
Hide file tree
Showing 2 changed files with 12 additions and 12 deletions.
14 changes: 7 additions & 7 deletions ts/features/cie/analytics/index.ts
Original file line number Diff line number Diff line change
Expand Up @@ -41,26 +41,26 @@ export const trackWizardCieIdSelected = async (
state: GlobalState,
spidLevel: SpidLevel
) => {
await updateMixpanelProfileProperties(state, {
property: "LOGIN_METHOD",
value: IdpCIE_ID.id
});
void mixpanelTrack(
"LOGIN_CIE_WIZARD_CIEID_SELECTED",
buildEventProperties("UX", "action", {
security_level: SECURITY_LEVEL_MAP[spidLevel]
})
);
};
export const trackWizardCiePinSelected = async (state: GlobalState) => {
await updateMixpanelProfileProperties(state, {
property: "LOGIN_METHOD",
value: IdpCIE.id
value: IdpCIE_ID.id
});
};
export const trackWizardCiePinSelected = async (state: GlobalState) => {
void mixpanelTrack(
"LOGIN_CIE_WIZARD_PIN_SELECTED",
buildEventProperties("UX", "action")
);
await updateMixpanelProfileProperties(state, {
property: "LOGIN_METHOD",
value: IdpCIE.id
});
};
export const trackWizardCiePinInfoSelected = async () => {
void mixpanelTrack(
Expand Down
10 changes: 5 additions & 5 deletions ts/screens/authentication/analytics/index.ts
Original file line number Diff line number Diff line change
Expand Up @@ -23,26 +23,26 @@ export async function trackCieLoginSelected() {
mixpanelTrack("LOGIN_CIE_SELECTED", buildEventProperties("UX", "action"));
}
export async function trackCiePinLoginSelected(state: GlobalState) {
mixpanelTrack("LOGIN_CIE_PIN_SELECTED", buildEventProperties("UX", "action"));
await updateMixpanelProfileProperties(state, {
property: "LOGIN_METHOD",
value: IdpCIE.id
});
mixpanelTrack("LOGIN_CIE_PIN_SELECTED", buildEventProperties("UX", "action"));
}
export async function trackCieIDLoginSelected(
state: GlobalState,
spidLevel: SpidLevel
) {
await updateMixpanelProfileProperties(state, {
property: "LOGIN_METHOD",
value: IdpCIE_ID.id
});
mixpanelTrack(
"LOGIN_CIEID_SELECTED",
buildEventProperties("UX", "action", {
security_level: SECURITY_LEVEL_MAP[spidLevel]
})
);
await updateMixpanelProfileProperties(state, {
property: "LOGIN_METHOD",
value: IdpCIE_ID.id
});
}
export async function trackCieBottomSheetScreenView() {
mixpanelTrack(
Expand Down

0 comments on commit fcca9d5

Please sign in to comment.