-
Notifications
You must be signed in to change notification settings - Fork 3k
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
Add error message in case of integration sync failure #42307
Add error message in case of integration sync failure #42307
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.
small comments, generally LGTM
src/components/MenuItem.tsx
Outdated
/** Hint to display at the bottom of the component */ | ||
hintText?: MaybePhraseKey; | ||
|
||
/** Should the description be shown above the title (instead of the other way around) */ |
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.
is the description or variable name correct?
|
||
errorText: hasSynchronizationError(policy, connectedIntegration) ? translate('workspace.accounting.syncError', connectedIntegration) : undefined, | ||
errorTextStyle: {marginTop: 8}, | ||
shouldShowErrorTextRedDot: true, |
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.
should it be always true?
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.
In the majority of cases we use this error text without a red dot, so I decided to use shouldShowErrorTextRedDot this way.
…@szymczak/error-message-sync-failure
@francoisl @SzymczakJ tried to make the sync fail by:
It should have triggered an error, no? It seems like we don't validate/refresh the token here I'm sure there is a reason behind it, so feel free to tell me (I've seen the related issue, but I'd like to know if this is expected or not) 😄 |
Also this QBO bug is related #42250 (comment) |
No because the Xero integration uses OAuth, it's independent from your Xero account's password (that's one of the major points of OAuth after all). If you want to invalidate the OAuth credentials, try to go to https://apps.xero.com/ and then "My Apps" (top right corner) > Connected Apps, then disconnect all the |
src/languages/en.ts
Outdated
return "Couldn't connect to QuickBooks Online due to incorrect credentials."; | ||
case CONST.POLICY.CONNECTIONS.NAME.XERO: | ||
return "Couldn't connect to Xero due to incorrect credentials."; | ||
default: { | ||
return "Couldn't connect to integration due to incorrect credentials."; |
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 don't know if "due to incorrect credentials" is the correct thing to say here. The lastSync.isSuccessful
flag is used for any sync error, not just invalid credentials. It could be something like third-party was down, or the user is missing permissions in the third-party for what we're trying to do, etc.
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.
Thank you François for answering quickly my previous question and raising this point!
cc @trjExpensify @zanyrenney in the Xero DD, and in the Figma we would show this Couldn't connect to Xero due to incorrect credentials.
message.
But since it can be a lot of completely different things, maybe we need to change it?
Before having this discussion, I suggested to @SzymczakJ using as copy something like Couldn't connect to {integrationName}.
. Generic yes, but it fits all the possible use cases. What do you think?
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.
Zany might have more context, but I think this was just an example where incorrect credentials are at fault, but the intention is to pass in the most relevant error we have. Do we not have all of these in OldDot already?
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.
Okay so after investigating, when sync fails, we have error codes (401
and 407
) we can use to display a meaningful error message to the user.
Currently on OD, the Xero error message when session has expired is:
xeroConnectFailedMessage: 'Your connection to Xero seems to have expired. Do you want to reconnect now?',
It appears in a modal like below:
We also have dynamic error messages in place (we could reuse the same thought process for QBO):
genericConnectFailedTitle: 'Couldn\'t connect to <%- connectionName %>',
genericConnectFailedMessage: 'Your connection to <%- connectionName %> has expired. You can correct this by clicking <b>Reconnect</b> and reauthorizing Expensify with <%- connectionName %>.',
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.
Okay cool, so in this case for NewDot, would the button inside the three dot overflow menu read Enter credentials
in this scenario? So our direction would be to point to that instead of a "Reconnect" button?
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 we might want to keep it, at least for errors when connecting (not autoSync/export/manual export errors that are out of scope). Especially to demo it at XeroCon.
Thoughts @trjExpensify @arosiclair?
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.
Yeah I think we can keep it though the error we show here should just a generic message like Francois mentioned
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.
Yes, when connecting I agree. 👍
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.
So I should proceed with generic error message like "Couldn't connect to {integration}.", right? @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.
Yep! This one I believe:
genericConnectFailedTitle: 'Couldn't connect to <%- connectionName %>',
@francoisl do you have any information about QBO? I've described the problem here #42250 (comment) |
Responding in that issue directly. |
@Expensify/design can you check it up if it looks good to you? Thanks! |
For the error message style, I think we actually want something more like this: Fairly certain these RBR errors should be dismissible, right @trjExpensify ? As for spacing, we want to use a small 8px gap between the Xero row and the error message: Let me know if that makes sense, cc @Expensify/design for vis |
Ah, no. Not this one. This is an integration issue you have to fix to get it working again. |
Definitely agree about the spacing/styles. Will lean on Tom about dismiss-ability. |
Nice!! |
@SzymczakJ could you please update the design |
@rushatgabhane updated styles |
@rushatgabhane quick bump 😄 |
src/components/MenuItem.tsx
Outdated
/** Hint to display at the bottom of the component */ | ||
hintText?: MaybePhraseKey; | ||
|
||
/** Should the error text red dot indicator be shown */ | ||
shouldShowErrorTextRedDot?: boolean; |
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 not name this as shouldShowRedDotIndicator
? This is consistent across and red dot is generally associated with errors.
I’ll review this today. |
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.
Code change looks good to me. I'll test and work on the checklist in a few hours.
Reviewer Checklist
Screenshots/Videos |
We did not find an internal engineer to review this PR, trying to assign a random engineer to #42250 as well as to this PR... Please reach out for help on Slack if no one gets assigned! |
@Expensify/design could you please give it a final review, with the updated styles? |
Screenshots above look pretty good to me! |
🚀 Deployed to staging by https://github.com/lakchote in version: 1.4.77-11 🚀
|
🚀 Deployed to staging by https://github.com/lakchote in version: 1.4.77-11 🚀
|
🚀 Deployed to production by https://github.com/mountiny in version: 1.4.78-5 🚀
|
Details
Fixed Issues
$ #42250
PROPOSAL: N/A
Tests
Offline tests
QA Steps
Same as tests.
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
MacOS: Desktop