-
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
Offline and errors pattern in Quickbooks Online integration #46511
Offline and errors pattern in Quickbooks Online integration #46511
Conversation
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.
You've performed a titanic work here 🤯 Please address the comments and then we're ready for C+ review 🔥
src/pages/workspace/accounting/qbo/advanced/QuickbooksAccountSelectPage.tsx
Outdated
Show resolved
Hide resolved
src/pages/workspace/accounting/qbo/advanced/QuickbooksAccountSelectPage.tsx
Outdated
Show resolved
Hide resolved
src/pages/workspace/accounting/qbo/advanced/QuickbooksAdvancedPage.tsx
Outdated
Show resolved
Hide resolved
src/pages/workspace/accounting/qbo/advanced/QuickbooksAdvancedPage.tsx
Outdated
Show resolved
Hide resolved
src/pages/workspace/accounting/qbo/advanced/QuickbooksInvoiceAccountSelectPage.tsx
Outdated
Show resolved
Hide resolved
src/pages/workspace/accounting/qbo/export/QuickbooksCompanyCardExpenseAccountPage.tsx
Show resolved
Hide resolved
src/pages/workspace/accounting/qbo/export/QuickbooksCompanyCardExpenseAccountPage.tsx
Outdated
Show resolved
Hide resolved
src/pages/workspace/accounting/qbo/export/QuickbooksCompanyCardExpenseAccountPage.tsx
Outdated
Show resolved
Hide resolved
src/pages/workspace/accounting/qbo/export/QuickbooksCompanyCardExpenseAccountPage.tsx
Outdated
Show resolved
Hide resolved
src/pages/workspace/accounting/qbo/import/QuickbooksChartOfAccountsPage.tsx
Outdated
Show resolved
Hide resolved
src/pages/workspace/accounting/qbo/export/QuickbooksPreferredExporterConfigurationPage.tsx
Outdated
Show resolved
Hide resolved
hi @kirillzyusko, since the new React Compiler check was introduced, the flow is failing for me with components that my PR hasn't touched at all.
|
Hey @zfurtak Which errors I believe if you run |
This is exactly what I did, here is the output I got:
EDIT: At this point I don't know how to solve them 🧐 |
hi 👋 About the error messages, we were changing the flow of showing them, however we didn't update the messages and sticked with previous ones (same as on staging). However I discovered a problem related to this part (video below). 🐛The title should be Screen.Recording.2024-08-14.at.14.42.36.movcc @ikevin127 @dubielzyk-expensify @shawnborton @trjExpensify |
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.
2. "Accounting > Export > Export company card expenses as" empty Bank account page is grayed-out after changing Export as while offline | 🟢 FIXED
I'm still not sure what should I do with the error on the empty page from the first point 🤔
Which leaves the issue number 1 with the error placed at the bottom of the empty page:
I think given that the design team doesn't feel strongly about it (ref1, ref2) I think we can leave it like that.
The title should be
Not configured
but the value ofreimbursableExpensesAccount.name
(from QBO config) remains from the previous option, as we passundefined
to onyx. I tried to change it in the code to clear the value withnull
but the backend doesn't allow it. Could you consider this as a possible issue?
Not sure regarding this issue, sounds like we might want to handle it here but it might require BE changes so I'll defer this to assigned CME to decide whether to handle this here or in a new issue.
cc @deetergp on the sentence ^ above!
Otherwise, PR tests well, LGTM 🚀
Can we elaborate on HOW the backend is preventing us from clearing this out? Which API command is returning the |
@deetergp We use the Now it's done this way
but if the We tried to pass That's why we think this issue is BE related but maybe there is a way of clearing the value. Any help would be appreciated 🙏 |
hi @deetergp, could you take a look at this issue? 😊 |
@deetergp |
My apologies @zfurtak, I will investigate those BE changes today. |
Hello @deetergp, how is it going? 😃 |
@deetergp sure thing! |
Hi @deetergp, at the moment the code that connects back and front is being changed, maybe this refactor will fix the problem at the same time. 🤔. |
}; | ||
API.write(WRITE_COMMANDS.UPDATE_QUICKBOOKS_ONLINE_REIMBURSABLE_EXPENSES_ACCOUNT, parameters, onyxData); | ||
} | ||
|
||
function updateQuickbooksOnlineSyncLocations(policyID: string, settingValue: IntegrationEntityMap) { | ||
const onyxData = buildOnyxDataForQuickbooksConfiguration(policyID, CONST.QUICK_BOOKS_CONFIG.SYNC_LOCATIONS, settingValue); | ||
function updateQuickbooksOnlineSyncLocations(policyID: string, settingValue: IntegrationEntityMap, oldValue?: IntegrationEntityMap) { |
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.
I have a small proposal
Maybe you will like it 😅
I also started making a similar PR today by mistake
And how do you like this format of typing?
We can be sure that the parameters passed will have correct types
Plus we can reuse TSettingValue for settingValue and oldValue
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.
I like it! Should I do it right away here or do you prefer to merge your PR? 😊
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.
I think yours is better
Since my PR is in draft and requires filling out checklists 😅
Plus it's better to close it since there is your PR
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.
Done 🤓
✋ 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/deetergp in version: 9.0.30-0 🚀
|
@@ -92,6 +90,7 @@ function buildOnyxDataForQuickbooksConfiguration<TSettingName extends keyof Conn | |||
policyID: string, | |||
settingName: TSettingName, | |||
settingValue: Partial<Connections['quickbooksOnline']['config'][TSettingName]>, | |||
oldSettingValue?: Partial<Connections['quickbooksOnline']['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.
Why did we make this value optional with ?
? I think it is not optional and it looks like we are passing it in every call
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.
It's because we pass values from QuickbooksOnline config that can be undefined
e.g. here
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.
ohh, I see, thanks!
contentContainerStyle={styles.pb2} | ||
titleStyle={styles.ph5} | ||
connectionName={CONST.POLICY.CONNECTIONS.NAME.QBO} | ||
onBackButtonPress={() => Navigation.goBack(ROUTES.POLICY_ACCOUNTING.getRoute(policyID))} |
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.
Looks like having a fallback to the goBack
function here led to the following issue:
which was fixed by removing the fallback, more details in the proposed solution.
Details
Fixed Issues
$#45406 - partially fixed
PROPOSAL:
Tests
Test errors:
Simulate failing network
inTroubleshooting
(you can setMAX_REQUEST_RETRIES
to 0 to get errors faster).Settings
->Workspaces
-> your QuickbooksOnline workspace ->Accounting
.Offline tests
Settings
->Workspaces
-> your QuickbooksOnline workspace ->Accounting
.QA Steps
Test errors:
Simulate failing network
inTroubleshooting
(you can setMAX_REQUEST_RETRIES
to 0 to get errors faster).Settings
->Workspaces
-> your QuickbooksOnline workspace ->Accounting
.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
#### Offline https://github.com/user-attachments/assets/8bf46e3d-8f15-4a88-a2cf-592bd7ac8df2Errors
android-error-1.mov
Android: mWeb Chrome
Offline
mweb-android-offline-1.mov
Errors
mweb-android-errors-1.mov
iOS: Native
Offline
ios-offline-1.mov
Errors
ios-error-1.mov
iOS: mWeb Safari
Offline
mweb-ios-offline-1.mov
Errors
mweb-ios-error-1.mov
MacOS: Chrome / Safari
Offline
web-offline-1.mov
Errors
web-error-1.mov
MacOS: Desktop
#### Offline https://github.com/user-attachments/assets/beeb1c13-53bc-4be2-8208-28f6dda6febbErrors
desktop-error-1.mov