-
Notifications
You must be signed in to change notification settings - Fork 2.9k
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
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! 🧪🧪
|
@@ -51,7 +51,7 @@ function QuickbooksImportPage({policy}: WithPolicyProps) { | |||
}, | |||
]; | |||
|
|||
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.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
hmm that is probably a good idea, then we wouldn't get a random crash because our types would catch it
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
@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 |
@@ -46,7 +46,7 @@ function updatePolicyConnectionConfig<TConnectionName extends ConnectionName, TS | |||
policyID: string, | |||
connectionName: TConnectionName, | |||
settingName: TSettingName, | |||
settingValue?: Partial<Connections[TConnectionName]['config'][TSettingName]>, | |||
settingValue: Partial<Connections[TConnectionName]['config'][TSettingName]>, |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
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.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
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.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
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.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
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
Import
to 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 exporter
page 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 Issues
section aboveTests
sectionOffline steps
sectionQA steps
sectiontoggleReport
and notonIconClick
)myBool && <MyComponent />
.src/languages/*
files and using the translation methodSTYLE.md
) were followedAvatar
, I verified the components usingAvatar
are working as expected)StyleUtils.getBackgroundAndBorderStyle(theme.componentBG)
)Avatar
is modified, I verified thatAvatar
is working as expected in all cases)Design
label and/or tagged@Expensify/design
so the design team can review the changes.ScrollView
component to make it scrollable when more elements are added to the page.main
branch was merged into this PR after a review, I tested again and verified the outcome was still expected according to theTest
steps.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