Commit c680ca3
authored
feat: add error_type to REHYDRATION_PASSWORD_FAILED event (MetaMask#21906)
## **Description**
Added `error_type` property to the `REHYDRATION_PASSWORD_FAILED`
analytics event to distinguish between incorrect password errors and
other error types during social login rehydration.
**Changes:**
- Added `error_type: 'incorrect_password'` to
`REHYDRATION_PASSWORD_FAILED` event tracking
- Applied to both standard password errors and seedless onboarding
incorrect password errors
- Only tracks during OAuth rehydration flow
(`isComingFromOauthOnboarding`)
## **Changelog**
CHANGELOG entry: null
## **Related issues**
Fixes: https://consensyssoftware.atlassian.net/browse/SL-240
## **Manual testing steps**
```gherkin
Feature: Social login rehydration error tracking
Scenario: user enters incorrect password during social login rehydration
Given user has a social login account
And user is on the login screen after OAuth authentication
When user enters an incorrect password
Then REHYDRATION_PASSWORD_FAILED event is tracked with error_type: 'incorrect_password'
And the event includes account_type: 'social' and failed_attempts count
```
## **Screenshots/Recordings**
N/A - Analytics tracking change only
### **Before**
`REHYDRATION_PASSWORD_FAILED` event tracked without `error_type`
property
### **After**
`REHYDRATION_PASSWORD_FAILED` event tracked with `error_type:
'incorrect_password'`
## **Pre-merge author checklist**
- [x] I've followed [MetaMask Contributor
Docs](https://github.com/MetaMask/contributor-docs) and [MetaMask Mobile
Coding
Standards](https://github.com/MetaMask/metamask-mobile/blob/main/.github/guidelines/CODING_GUIDELINES.md).
- [x] I've completed the PR template to the best of my ability
- [x] I've included tests if applicable
- [x] I've documented my code using [JSDoc](https://jsdoc.app/) format
if applicable
- [x] I've applied the right labels on the PR (see [labeling
guidelines](https://github.com/MetaMask/metamask-mobile/blob/main/.github/guidelines/LABELING_GUIDELINES.md)).
Not required for external contributors.
## **Pre-merge reviewer checklist**
- [x] I've manually tested the PR (e.g. pull and build branch, run the
app, test code being changed).
- [x] I confirm that this PR addresses all acceptance criteria described
in the ticket it closes and includes the necessary testing evidence such
as recordings and or screenshots.
<!-- CURSOR_SUMMARY -->
---
> [!NOTE]
> Adds error_type to REHYDRATION_PASSWORD_FAILED during social login
rehydration, distinguishing incorrect_password from unknown_error, with
updated tests.
>
> - **Analytics (Login)**:
> - Track `REHYDRATION_PASSWORD_FAILED` with `error_type:
'incorrect_password'` for wrong password cases (`WRONG_PASSWORD_ERROR`,
Android variants) during OAuth rehydration.
> - Track `error_type: 'incorrect_password'` on seedless
`IncorrectPassword` and `TooManyLoginAttempts` (syncs failed attempts),
and `error_type: 'unknown_error'` on seedless `PasswordRecentlyUpdated`
and other unexpected OAuth failures.
> - Remove generic tracking from `handlePasswordError`; add final
fallback tracking with `error_type: 'unknown_error'` for other OAuth
errors.
> - **Tests (Login)**:
> - Mock `trackOnboarding` and assert events include `error_type` for
all wrong password variants; ensure not tracked for
`PASSWORD_REQUIREMENTS_NOT_MET`.
> - Add coverage for Android error variant `_2`; minor suite rename to
clarify navigation checks.
>
> <sup>Written by [Cursor
Bugbot](https://cursor.com/dashboard?tab=bugbot) for commit
fcd807c. This will update automatically
on new commits. Configure
[here](https://cursor.com/dashboard?tab=bugbot).</sup>
<!-- /CURSOR_SUMMARY -->1 parent 8d30e14 commit c680ca3
2 files changed
Lines changed: 185 additions & 115 deletions
| Original file line number | Diff line number | Diff line change | |
|---|---|---|---|
| |||
135 | 135 | | |
136 | 136 | | |
137 | 137 | | |
| 138 | + | |
| 139 | + | |
| 140 | + | |
| 141 | + | |
138 | 142 | | |
139 | 143 | | |
140 | 144 | | |
| |||
195 | 199 | | |
196 | 200 | | |
197 | 201 | | |
| 202 | + | |
| 203 | + | |
| 204 | + | |
198 | 205 | | |
199 | 206 | | |
200 | 207 | | |
| |||
209 | 216 | | |
210 | 217 | | |
211 | 218 | | |
| 219 | + | |
212 | 220 | | |
213 | 221 | | |
214 | 222 | | |
| |||
499 | 507 | | |
500 | 508 | | |
501 | 509 | | |
502 | | - | |
| 510 | + | |
503 | 511 | | |
504 | 512 | | |
505 | 513 | | |
| |||
740 | 748 | | |
741 | 749 | | |
742 | 750 | | |
743 | | - | |
744 | | - | |
745 | | - | |
746 | | - | |
747 | | - | |
748 | | - | |
749 | | - | |
750 | | - | |
751 | | - | |
752 | | - | |
753 | | - | |
754 | | - | |
755 | | - | |
756 | | - | |
757 | | - | |
758 | | - | |
759 | | - | |
760 | | - | |
761 | | - | |
762 | | - | |
763 | | - | |
764 | | - | |
765 | | - | |
766 | | - | |
767 | | - | |
768 | | - | |
769 | | - | |
770 | | - | |
771 | | - | |
772 | | - | |
773 | | - | |
774 | | - | |
775 | | - | |
776 | | - | |
777 | | - | |
778 | | - | |
779 | | - | |
780 | | - | |
781 | | - | |
782 | | - | |
783 | | - | |
784 | | - | |
785 | | - | |
786 | | - | |
787 | | - | |
788 | | - | |
789 | | - | |
790 | | - | |
791 | | - | |
792 | | - | |
793 | | - | |
794 | | - | |
795 | | - | |
796 | | - | |
797 | | - | |
798 | | - | |
799 | | - | |
800 | | - | |
801 | | - | |
802 | | - | |
803 | | - | |
804 | | - | |
805 | | - | |
806 | | - | |
807 | | - | |
808 | | - | |
809 | | - | |
810 | | - | |
811 | | - | |
812 | | - | |
813 | | - | |
814 | | - | |
815 | | - | |
816 | | - | |
817 | | - | |
818 | | - | |
819 | | - | |
820 | | - | |
821 | | - | |
822 | | - | |
823 | | - | |
824 | | - | |
825 | | - | |
826 | | - | |
827 | | - | |
828 | | - | |
829 | | - | |
830 | | - | |
831 | | - | |
832 | | - | |
833 | | - | |
834 | | - | |
835 | | - | |
836 | | - | |
837 | | - | |
838 | | - | |
839 | | - | |
840 | | - | |
841 | | - | |
842 | | - | |
843 | | - | |
844 | | - | |
845 | | - | |
846 | | - | |
847 | | - | |
848 | 751 | | |
849 | 752 | | |
850 | 753 | | |
| |||
950 | 853 | | |
951 | 854 | | |
952 | 855 | | |
| 856 | + | |
953 | 857 | | |
954 | 858 | | |
955 | 859 | | |
956 | 860 | | |
957 | 861 | | |
958 | 862 | | |
959 | 863 | | |
| 864 | + | |
| 865 | + | |
| 866 | + | |
| 867 | + | |
| 868 | + | |
| 869 | + | |
| 870 | + | |
| 871 | + | |
| 872 | + | |
| 873 | + | |
| 874 | + | |
| 875 | + | |
960 | 876 | | |
961 | 877 | | |
962 | 878 | | |
| |||
976 | 892 | | |
977 | 893 | | |
978 | 894 | | |
| 895 | + | |
| 896 | + | |
| 897 | + | |
| 898 | + | |
| 899 | + | |
| 900 | + | |
| 901 | + | |
| 902 | + | |
| 903 | + | |
| 904 | + | |
| 905 | + | |
| 906 | + | |
| 907 | + | |
| 908 | + | |
| 909 | + | |
| 910 | + | |
979 | 911 | | |
980 | 912 | | |
981 | 913 | | |
| 914 | + | |
| 915 | + | |
| 916 | + | |
| 917 | + | |
| 918 | + | |
| 919 | + | |
| 920 | + | |
| 921 | + | |
| 922 | + | |
| 923 | + | |
| 924 | + | |
| 925 | + | |
982 | 926 | | |
983 | 927 | | |
984 | 928 | | |
| |||
1000 | 944 | | |
1001 | 945 | | |
1002 | 946 | | |
| 947 | + | |
| 948 | + | |
| 949 | + | |
| 950 | + | |
| 951 | + | |
| 952 | + | |
| 953 | + | |
| 954 | + | |
| 955 | + | |
| 956 | + | |
| 957 | + | |
| 958 | + | |
| 959 | + | |
| 960 | + | |
| 961 | + | |
| 962 | + | |
| 963 | + | |
| 964 | + | |
| 965 | + | |
| 966 | + | |
| 967 | + | |
| 968 | + | |
| 969 | + | |
| 970 | + | |
| 971 | + | |
| 972 | + | |
| 973 | + | |
| 974 | + | |
| 975 | + | |
| 976 | + | |
| 977 | + | |
| 978 | + | |
| 979 | + | |
| 980 | + | |
| 981 | + | |
| 982 | + | |
| 983 | + | |
| 984 | + | |
| 985 | + | |
| 986 | + | |
| 987 | + | |
| 988 | + | |
| 989 | + | |
| 990 | + | |
| 991 | + | |
| 992 | + | |
| 993 | + | |
| 994 | + | |
| 995 | + | |
| 996 | + | |
| 997 | + | |
| 998 | + | |
| 999 | + | |
| 1000 | + | |
| 1001 | + | |
| 1002 | + | |
| 1003 | + | |
| 1004 | + | |
| 1005 | + | |
| 1006 | + | |
| 1007 | + | |
| 1008 | + | |
| 1009 | + | |
| 1010 | + | |
| 1011 | + | |
| 1012 | + | |
1003 | 1013 | | |
1004 | 1014 | | |
1005 | 1015 | | |
| 1016 | + | |
| 1017 | + | |
| 1018 | + | |
| 1019 | + | |
| 1020 | + | |
| 1021 | + | |
| 1022 | + | |
| 1023 | + | |
| 1024 | + | |
| 1025 | + | |
| 1026 | + | |
| 1027 | + | |
1006 | 1028 | | |
1007 | 1029 | | |
1008 | 1030 | | |
| |||
1022 | 1044 | | |
1023 | 1045 | | |
1024 | 1046 | | |
| 1047 | + | |
| 1048 | + | |
| 1049 | + | |
| 1050 | + | |
| 1051 | + | |
| 1052 | + | |
| 1053 | + | |
| 1054 | + | |
1025 | 1055 | | |
1026 | 1056 | | |
1027 | 1057 | | |
| |||
0 commit comments