Display Xero disable 2FA error from backend#57202
Conversation
|
@allgandalf Please copy/paste the Reviewer Checklist from here into a new comment on this PR and complete it. If you have the K2 extension, you can simply click: [this button] |
allgandalf
left a comment
There was a problem hiding this comment.
NAB's but few comments
|
|
||
| const closeModal = useCallback(() => { | ||
| clearDisableTwoFactorAuthErrors(); | ||
| Navigation.goBack(); |
There was a problem hiding this comment.
| Navigation.goBack(); | |
| Navigation.dismissModal(); |
Makes more sense ?
There was a problem hiding this comment.
No I specifically want to go back to the previous page. Is that the right way to do it? What would you advise and why?
There was a problem hiding this comment.
Let me test both approaches and get back
|
@neil-marcellini we have failing typecheck here |
I don't see that. Would you please check again? |
Reviewer Checklist
Screenshots/VideosAndroid: NativeScreen.Recording.2025-03-09.at.2.49.31.PM.movAndroid: mWeb ChromeScreen.Recording.2025-03-09.at.2.50.52.PM.moviOS: NativeScreen.Recording.2025-03-09.at.2.48.30.PM.moviOS: mWeb SafariScreen.Recording.2025-03-09.at.2.47.16.PM.movMacOS: Chrome / SafariScreen.Recording.2025-03-09.at.2.46.03.PM.movMacOS: DesktopScreen.Recording.2025-03-09.at.2.46.31.PM.mov |
|
@MarioExpensify Please copy/paste the Reviewer Checklist from here into a new comment on this PR and complete it. If you have the K2 extension, you can simply click: [this button] |
allgandalf
left a comment
There was a problem hiding this comment.
sorry approved this by mistake, i found that it's not working on iOS native:
PR is failing for iOS:
Screen.Recording.2025-03-07.at.8.47.33.PM.mov
|
@neil-marcellini it only works after i open the workspace atleast once: Screen.Recording.2025-03-07.at.8.49.42.PM.mov |
Sorry I left out a test step! You need to submit the 2FA code and then the modal will pop up. We're specifically checking that the backend causes the modal to show up after submitting the 2FA code if the modal doesn't show up previously due to the policy not being loaded. |
|
@marcochavezf Please copy/paste the Reviewer Checklist from here into a new comment on this PR and complete it. If you have the K2 extension, you can simply click: [this button] |
|
On it! |
|
✋ This PR was not deployed to staging yet because QA is ongoing. It will be automatically deployed to staging after the next production release. |
|
🚀 Deployed to staging by https://github.com/MarioExpensify in version: 9.1.11-1 🚀
|
|
🚀 Deployed to production by https://github.com/mountiny in version: 9.1.12-7 🚀
|
Explanation of Change
When a user has just signed in and they go to disable two factor Auth, the backend will now throw an error if the user is an admin of any policy that has an accounting connection to Xero. We also check this on the frontend, but there's no guarantee all the user's policies will be loaded. The error is displayed using the same modal as for the frontend check.
I also ran into a problem when testing this, which is that the autocomplete event from 1Password was firing multiple "Enter" keypress events, even though I just clicked its autocomplete suggestion once. One of these events would occur after the modal opened and since it handles press of the "Enter" key it would immediately close it. The solution I found was to ignore that event if it's target was for the input and not the button it should be attached to, which I think seems reasonable.
Fixed Issues
$ #52850
PROPOSAL: N/A
Tests
Offline tests
N/A
QA Steps
Same as tests
PR Author Checklist
### Fixed Issuessection aboveTestssectionOffline stepssectionQA stepssectiontoggleReportand notonIconClick)src/languages/*files and using the translation methodSTYLE.md) were followedAvatar, I verified the components usingAvatarare working as expected)StyleUtils.getBackgroundAndBorderStyle(theme.componentBG))Avataris modified, I verified thatAvataris working as expected in all cases)Designlabel and/or tagged@Expensify/designso the design team can review the changes.ScrollViewcomponent to make it scrollable when more elements are added to the page.mainbranch was merged into this PR after a review, I tested again and verified the outcome was still expected according to theTeststeps.Screenshots/Videos
I only tested on web because the changes should be platform independent and the C+ will test all platforms.
Android: Native
Android: mWeb Chrome
iOS: Native
iOS: mWeb Safari
MacOS: Chrome / Safari
2025-02-20_14-02-02.mp4
MacOS: Desktop