Commit 4dd36e7
release(runway): cherry-pick fix: fixed User Login Cancelled Error for firefox cp-13.9.0 (#37672)
- fix: fixed User Login Cancelled Error for firefox cp-13.9.0 (#37658)
<!--
Please submit this PR as a draft initially.
Do not mark it as "Ready for review" until the template has been
completely filled out, and PR status checks have passed at least once.
-->
## **Description**
<!--
Write a short description of the changes included in this pull request,
also include relevant motivation and context. Have in mind the following
questions:
1. What is the reason for the change?
2. What is the improvement/solution?
-->
[](https://codespaces.new/MetaMask/metamask-extension/pull/37658?quickstart=1)
## **Changelog**
<!--
If this PR is not End-User-Facing and should not show up in the
CHANGELOG, you can choose to either:
1. Write `CHANGELOG entry: null`
2. Label with `no-changelog`
If this PR is End-User-Facing, please write a short User-Facing
description in the past tense like:
`CHANGELOG entry: Added a new tab for users to see their NFTs`
`CHANGELOG entry: Fixed a bug that was causing some NFTs to flicker`
(This helps the Release Engineer do their job more quickly and
accurately)
-->
CHANGELOG entry: null
## **Related issues**
Fixes: #37645
## **Manual testing steps**
1. In firefox, start new onboarding with social login.
2. Before completing the social login, close the window.
3. User should not see Login Error modal
## **Screenshots/Recordings**
<!-- If applicable, add screenshots and/or recordings to visualize the
before and after of your change. -->
### **Before**
<!-- [screenshots/recordings] -->
### **After**
<!-- [screenshots/recordings] -->
## **Pre-merge author checklist**
- [x] I've followed [MetaMask Contributor
Docs](https://github.com/MetaMask/contributor-docs) and [MetaMask
Extension Coding
Standards](https://github.com/MetaMask/metamask-extension/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-extension/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 cross-browser detection for user-cancelled OAuth logins and
updates OAuth flow and onboarding UI to suppress errors when users close
the login window, including Firefox-specific message support.
>
> - **Shared/Error Handling**:
> - Add `OAuthErrorMessages.USER_CANCELLED_LOGIN_ERROR_FIREFOX` and new
helper `isUserCancelledLoginError` to detect user-cancelled OAuth across
browsers.
> - **OAuth Service (`app/scripts/services/oauth/oauth-service.ts`)**:
> - Replace `#isUserCancelledLoginError` with
`#getUserCancelledLoginError` using `isUserCancelledLoginError` and
return the original error when present.
> - On missing `responseUrl`, check for user-cancelled error before
throwing `NO_REDIRECT_URL_FOUND_ERROR`.
> - **Onboarding UI (`ui/pages/onboarding-flow/welcome/welcome.js`)**:
> - Use `isUserCancelledLoginError` to ignore user-cancelled cases in
`handleSocialLoginError` and `handleLoginError`.
> - Remove unnecessary logging; keep existing error-to-UI mapping
unchanged otherwise.
>
> <sup>Written by [Cursor
Bugbot](https://cursor.com/dashboard?tab=bugbot) for commit
23ec974. This will update automatically
on new commits. Configure
[here](https://cursor.com/dashboard?tab=bugbot).</sup>
<!-- /CURSOR_SUMMARY -->
[ec63edb](ec63edb)
Co-authored-by: Lwin <147362763+lwin-kyaw@users.noreply.github.com>
Co-authored-by: Gauthier Petetin <gauthierpetetin@hotmail.com>1 parent ed9ed13 commit 4dd36e7
File tree
3 files changed
+37
-13
lines changed- app/scripts/services/oauth
- ui/pages/onboarding-flow/welcome
3 files changed
+37
-13
lines changed| Original file line number | Diff line number | Diff line change | |
|---|---|---|---|
| |||
1 | 1 | | |
2 | 2 | | |
3 | | - | |
| 3 | + | |
| 4 | + | |
| 5 | + | |
| 6 | + | |
4 | 7 | | |
5 | 8 | | |
6 | 9 | | |
| |||
204 | 207 | | |
205 | 208 | | |
206 | 209 | | |
207 | | - | |
208 | | - | |
209 | | - | |
210 | | - | |
| 210 | + | |
| 211 | + | |
| 212 | + | |
| 213 | + | |
211 | 214 | | |
212 | 215 | | |
| 216 | + | |
213 | 217 | | |
214 | 218 | | |
215 | 219 | | |
| |||
357 | 361 | | |
358 | 362 | | |
359 | 363 | | |
360 | | - | |
| 364 | + | |
361 | 365 | | |
362 | | - | |
| 366 | + | |
| 367 | + | |
| 368 | + | |
| 369 | + | |
363 | 370 | | |
364 | 371 | | |
365 | 372 | | |
| |||
| Original file line number | Diff line number | Diff line change | |
|---|---|---|---|
| |||
39 | 39 | | |
40 | 40 | | |
41 | 41 | | |
| 42 | + | |
| 43 | + | |
| 44 | + | |
42 | 45 | | |
43 | 46 | | |
44 | 47 | | |
| |||
47 | 50 | | |
48 | 51 | | |
49 | 52 | | |
| 53 | + | |
| 54 | + | |
| 55 | + | |
| 56 | + | |
| 57 | + | |
| 58 | + | |
| 59 | + | |
| 60 | + | |
| 61 | + | |
| 62 | + | |
| 63 | + | |
| 64 | + | |
| 65 | + | |
| 66 | + | |
| Original file line number | Diff line number | Diff line change | |
|---|---|---|---|
| |||
8 | 8 | | |
9 | 9 | | |
10 | 10 | | |
11 | | - | |
12 | 11 | | |
13 | 12 | | |
14 | 13 | | |
| |||
41 | 40 | | |
42 | 41 | | |
43 | 42 | | |
44 | | - | |
| 43 | + | |
| 44 | + | |
| 45 | + | |
| 46 | + | |
45 | 47 | | |
46 | 48 | | |
47 | 49 | | |
| |||
214 | 216 | | |
215 | 217 | | |
216 | 218 | | |
217 | | - | |
| 219 | + | |
218 | 220 | | |
219 | 221 | | |
220 | 222 | | |
| |||
354 | 356 | | |
355 | 357 | | |
356 | 358 | | |
357 | | - | |
358 | | - | |
359 | | - | |
| 359 | + | |
360 | 360 | | |
361 | 361 | | |
362 | 362 | | |
| |||
0 commit comments