-
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 a Not Found page for IOU reports that we cannot load #14028
Conversation
@mollfpr @Julesssss One of you needs to 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] |
src/pages/iou/IOUDetailsModal.js
Outdated
@@ -146,47 +147,54 @@ class IOUDetailsModal extends Component { | |||
|
|||
render() { | |||
const sessionEmail = lodashGet(this.props.session, 'email', null); | |||
const reportIsLoading = _.isUndefined(this.props.iouReport); | |||
const reportIsLoading = this.props.iou.loading; |
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.
@Julesssss I think this makes sense, right? This was the one part I was unsure about - the difference between iou
and iouReport
and if they're linked enough anyway that the loading
property from iou
would suffice.
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 try to log the this.props.iou.loading
inside the render function, but it returns false
on both accounts (the account that has the IOU data and the account which doesn't have the IOU data).
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 what are we saying? This prop is just useless anyway?
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.
Could be, but this.props.iou.loading
is also been used for disabling the settlement button. I will take a look more on the props.iou
.
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, yeah that one might be deprecated actually. it's probably better to check for the report itself in Onyx
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.
Alternatively, we can create single Onyx data to keep the loading state for the OpenPaymentDetailsPage API similar to what we did with the OpenApp API and ONYXKEYS.IS_LOADING_REPORT_DATA.
I think I like this - what do you think @Julesssss ?
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 that is pretty straight forward. Let's do 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.
Actually, on second look, I think we don't need this since we already load all iouReports when opening the app, and if one is ever created for you it is pushed to you via Pusher. So there would never be a state where we would need to be "loading" the IOU report data? Right?
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.
Ah nevermind no, this would be something that needs to wrap the OpenPaymentDetailsPage
command.
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.
Ah okay -
Could be, but this.props.iou.loading is also been used for disabling the settlement button. I will take a look more on the props.iou.
It's not useful anymore since we optimistically pay the IOU, so the settlement button's loading state is outdated. So, what I'll do is repurpose that loading
property for loading the iou report itself.
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.
Ran out of time, will need to finish up testing on Monday
Updated! |
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.
@mollfpr over to you for the checklist review |
@Julesssss Are we okay with showing the loading when the fetching happens while the data is already in Onyx? |
Yeah, I don't see why not. It should be a very short period and we can improve this later by matching the regular chats: |
Reviewer Checklist
Screenshots/Videos |
Screen.Recording.2023-01-11.at.20.25.50.mov@yuwenmemon @Julesssss When I open the IOU detail offline, it keeps showing the loading spinner. |
Oh, I didn't see that. When offline I still saw the same UI 😕 |
@Julesssss Wait, I’m confused 😳 Is this mean your end working fine offline? |
@mollfpr I see it - it's happening when you do have access to the IOU which is where I was getting confused as well. Looking into it! |
Updated! |
I can't test open the localhost link on native 😕 Any suggestion? @yuwenmemon @Julesssss |
I manually edited the link to something like |
Test well on offline too 👍 Here's the checklist |
✋ This PR was not deployed to staging yet because QA is ongoing. It will be automatically deployed to staging after the next production release. |
Performance Comparison Report 📊Significant Changes To DurationThere are no entries Meaningless Changes To DurationShow entries
Show details
|
🚀 Deployed to staging by @Julesssss in version: 1.2.54-0 🚀
|
🚀 Deployed to production by @AndrewGable in version: 1.2.54-2 🚀
|
@Julesssss @mollfpr please review
Details
As pointed out by @mollfpr here we were always showing a loading spinner if we didn't have an IOU report. Instead, we should be showing a report not found page and using the loading property in the IOU to show whether or not the report is loading.
Fixed Issues
$ #14011
Tests

4a. **For iOS/Android/Desktop:** From account C paste the link into a chat message. Then click on it. Make sure you see a page indicating the payment cannot be foundOffline tests
QA Steps
PR Author Checklist
### Fixed Issues
section aboveTests
sectionOffline steps
sectionQA steps
sectiontoggleReport
and notonIconClick
)src/languages/*
files and using the translation methodWaiting for Copy
label for a copy review on the original GH to get the correct copy.STYLE.md
) were followedAvatar
, I verified the components usingAvatar
are working as expected)/** comment above it */
this
properly so there are no scoping issues (i.e. foronClick={this.submit}
the methodthis.submit
should be bound tothis
in the constructor)this
are necessary to be bound (i.e. avoidthis.submit = this.submit.bind(this);
ifthis.submit
is never passed to a component event handler likeonClick
)StyleUtils.getBackgroundAndBorderStyle(themeColors.componentBG
)Avatar
is modified, I verified thatAvatar
is working as expected in all cases)ScrollView
component to make it scrollable when more elements are added to the page.Screenshots/Videos
Web
Mobile Web - Chrome
Mobile Web - Safari
Desktop
iOS
Android