Fix Preferred exporter page + country crash#41530
Conversation
|
@alitoshmatov 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] |
|
🧪🧪 Use the links below to test this adhoc build on Android, iOS, Desktop, and Web. Happy testing! 🧪🧪
|
| ]; | ||
|
|
||
| if (policy?.connections?.quickbooksOnline.data.country !== CONST.COUNTRY.US) { | ||
| if (policy?.connections?.quickbooksOnline?.data?.country !== CONST.COUNTRY.US) { |
There was a problem hiding this comment.
hmm that is probably a good idea, then we wouldn't get a random crash because our types would catch it
|
@alitoshmatov, we needed review quite quickly so I assigned @ikevin127 who was available at this time |
|
Few things when testing, not sure if I should have all the recent code merged to main + the changes in this PR:
2024-05-02_21-29-29.mp4 |
| connectionName: TConnectionName, | ||
| settingName: TSettingName, | ||
| settingValue?: Partial<Connections[TConnectionName]['config'][TSettingName]>, | ||
| settingValue: Partial<Connections[TConnectionName]['config'][TSettingName]>, |
There was a problem hiding this comment.
Fixed this here because settingValue is NOT optional. This was causing backend server errors.
| useEffect(() => { | ||
| if (!isTaxError && !isLocationError) { | ||
| return; | ||
| } | ||
| Connections.updatePolicyConnectionConfig(policyID, CONST.POLICY.CONNECTIONS.NAME.QBO, CONST.QUICK_BOOKS_CONFIG.REIMBURSABLE_EXPENSES_EXPORT_DESTINATION); | ||
| }, [policyID, isTaxError, isLocationError]); | ||
|
|
There was a problem hiding this comment.
This was calling updatePolicyConnectionConfig with an invalid value, which did nothing and is an anti-pattern in our app.
There was a problem hiding this comment.
We can fix this as part 1. of this issue: https://github.com/Expensify/Expensify/issues/390731
Reviewer Checklist
Screenshots/VideosAndroid: NativeAndroid: mWeb ChromeiOS: Native *ios.MP4iOS: mWeb SafariMacOS: Chrome / Safari *web.movMacOS: Desktop |
There was a problem hiding this comment.
Tests well following PR's description steps regarding the "Not found" page error.
✅ Additionally, following #41095 (comment), the country undefined crash seems to be fixed on my side with the following steps:
- Toggle "Sync reimbursed reports" on and off.
- Click on
Importto open the Import RHP, then also click on every RHP option.
LGTM 🚀 (lint check should pass though) ✅
|
@carlosmiceli 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] |
|
Thanks @ikevin127 , please re-approve, I had to remove an unused import (lint) |
|
@aldo-expensify All good, the only issue was lint not passing but you got that covered. I pulled latest changes and re-tested the steps mentioned at #41530 (review) -> everything works as expected. Approved ✅ |
|
Alright, I did a sync now on the adhoc build and now I can at least see all the accounts and stuff.
2024-05-02_22-57-15.mp4
|
Are you referring to that it is showing in the placeholder an account of the wrong type selected? This is out of the scope here.
I think this problem will remain until we solve: https://github.com/Expensify/Expensify/issues/390731
Note that his PR is only enabling the existing Preferred exporter page, I'm not fixing bugs found inside it. If I find it an easy fix, I'll do it here, otherwise in a follow up pr |
|
I'll merge this since filtering out the guide is a bit more complicated and it is a bug that was already there. I'll fix it in a follow up. |
|
✋ 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 production by https://github.com/marcaaron in version: 1.4.71-6 🚀
|










Details
Fixes the
Preferred exporterpage for the QBO Export settingsFixes this country crash: #41095 (comment)
Fixed Issues
$ #41463 (comment) (preferred exporter page not working)
$ #41095 (comment) (country crash)
PROPOSAL:
Tests
Offline tests
QA Steps
PR Author Checklist
### Fixed Issuessection aboveTestssectionOffline stepssectionQA stepssectiontoggleReportand notonIconClick)myBool && <MyComponent />.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
Android: Native
Android: mWeb Chrome
iOS: Native
iOS: mWeb Safari
MacOS: Chrome / Safari
Screen.Recording.2024-05-02.at.12.34.01.PM.mov
MacOS: Desktop