-
-
Couldn't load subscription status.
- Fork 1.4k
chore(runway): cherry-pick fix(ramps): cp-7.58.0 do not throw when user details fetch is 401 #21648
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
base: release/7.58.0
Are you sure you want to change the base?
Conversation
…er details fetch is 401 (#21633) <!-- 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** This PR fixes a bug where an error would display for users who's token has expired. Now they are silently logged out instead of throwing an error that is displayed to the user. <!-- 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? --> ## **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: fixed bug where an error message was incorrectly displayed to the user on the deposit page ## **Related issues** Fixes: #21642 ## **Manual testing steps** ```gherkin Feature: User Error Fix Scenario: logged-out user should not see error message Given user token has expired When user visits the deposit page Then user should not see an error ``` ## **Screenshots/Recordings** <!-- If applicable, add screenshots and/or recordings to visualize the before and after of your change. --> ### **Before** <img width="509" height="897" alt="Screenshot 2025-10-24 at 11 58 22 AM" src="https://github.com/user-attachments/assets/7e771356-f54e-4208-af21-8eb2004d017c" /> <!-- [screenshots/recordings] --> ### **After** <!-- [screenshots/recordings] --> ## **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** - [ ] I've manually tested the PR (e.g. pull and build branch, run the app, test code being changed). - [ ] 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] > `useDepositUser` now logs out without throwing on 401 while still throwing for non-401 errors; tests updated to reflect new behavior. > > - **Hooks**: > - `useDepositUser`: On `401`, log and call `logoutFromProvider(false)` without rethrowing; other errors continue to throw. > - **Tests**: > - Update 401 test to expect no throw and verify logout call; minor setup adjustments to align with new behavior. > > <sup>Written by [Cursor Bugbot](https://cursor.com/dashboard?tab=bugbot) for commit 54d5e23. This will update automatically on new commits. Configure [here](https://cursor.com/dashboard?tab=bugbot).</sup> <!-- /CURSOR_SUMMARY --> Co-authored-by: Pedro Pablo Aste Kompen <[email protected]>
|
CLA Signature Action: All authors have signed the CLA. You may need to manually re-run the blocking PR check if it doesn't pass in a few minutes. |
Codecov Report✅ All modified and coverable lines are covered by tests. Additional details and impacted files@@ Coverage Diff @@
## release/7.58.0 #21648 +/- ##
=================================================
Coverage ? 77.25%
=================================================
Files ? 3643
Lines ? 89850
Branches ? 17073
=================================================
Hits ? 69413
Misses ? 15734
Partials ? 4703 ☔ View full report in Codecov by Sentry. 🚀 New features to boost your workflow:
|
|



Description
This PR fixes a bug where an error would display for users who's token
has expired. Now they are silently logged out instead of throwing an
error that is displayed to the user.
Changelog
CHANGELOG entry: fixed bug where an error message was incorrectly
displayed to the user on the deposit page
Related issues
Fixes:
#21642
Manual testing steps
Screenshots/Recordings
Before
After
Pre-merge author checklist
Docs and MetaMask Mobile
Coding
Standards.
if applicable
guidelines).
Not required for external contributors.
Pre-merge reviewer checklist
app, test code being changed).
in the ticket it closes and includes the necessary testing evidence such
as recordings and or screenshots.
Note
Stops rethrowing 401 errors in
useDepositUserby logging out silently; updates tests to reflect non-throwing behavior on 401.useDepositUser)fetchUserDetails, log and calllogoutFromProvider(false)without rethrowing.useDepositUser.test.ts)Written by Cursor Bugbot for commit a08f393. This will update automatically on new commits. Configure here.
Co-authored-by: Pedro Pablo Aste Kompen [email protected] 3f30cb5