-
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
Stop fetching IOU data when a new report action arrives #9836
Conversation
@@ -189,7 +189,6 @@ function getSimplifiedReportObject(report) { | |||
lastMessageTimestamp, | |||
lastMessageText: isLastMessageAttachment ? '[Attachment]' : lastMessageText, | |||
lastActorEmail, | |||
hasOutstandingIOU: false, |
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'm not sure why this is being set here, but it seems wrong.
@@ -1382,9 +1344,8 @@ function syncChatAndIOUReports(chatReport, iouReport) { | |||
} | |||
simplifiedReport[chatReportKey] = getSimplifiedReportObject(chatReport); | |||
simplifiedReport[chatReportKey].hasOutstandingIOU = iouReport.stateNum | |||
=== (CONST.REPORT.STATE_NUM.PROCESSING && iouReport.total !== 0); |
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 logic was wrong and preventing the badge from updating
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 am using the mentioned Web-E branch to test with but I am getting a weird behaviour. See the attached video:
Screen.Recording.2022-07-20.at.11.05.13.mov
Basically, when I request multiple times, the details page behaves weird, it shows all of them and then it changes to only show the latest. Additionally, the background report is also changing which should not happen. I am not sure if this is only related to these changes or there could be some influence of the IOUDetailsPage updates we did recently.
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 is looking good overall. I noticed the same issue as Vit when testing, but I wonder if this is caused by a separate issue as I think I saw this once when testing my API refactor...
So, while copying your IOUReport data structure to fix a separate issue I noticed the exact same bug as we reported above, with the following console error:
I'm still not exactly sure why, but I think the issue is because an iouReport field is missing from your onyx update data. I'm not sure which field yet, but if you switch to returning |
I think this is the problematic line. For the initial render, |
@mountiny @Julesssss thanks for testing! Can one of you give me the step by step breakdown of what you did to get into that state? I am going to look at this again now... |
Oh hmm it is very obvious. Weird... I did not see this at all before. |
Yeah @Julesssss I think you're right and it's an issue with the |
But it's because of this line: $reportActions = $chatReport->getActionList()->filterByIOUReportID($iouReportID); The action list is not the same thing as report "history" so we just bypassed the "report actions" building logic. |
I'll add a change to my other PR - though maybe we should open a new PR with this commit in case that code is headed to staging / production soon? |
Nice. So yeah, I have a WIP PR that resolves a deploy blocker using your report structure. I'll apply the same fix to get this updated ASAP. However, are you not seeing an exception on this line when opening the PaymentDetailsPage? |
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.
Tested with the Web-E Pr and works well!
Just noting that I think the last step in the QA is not correct:
Verify the green and red badge in the chats list still shows there is an amount owed and that the amount is correct.
Off hold now that the Web-E PR is on production 🎉 |
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.
w00t gonna |
✋ This PR was not deployed to staging yet because QA is ongoing. It will be automatically deployed to staging after the next production release. |
Umm @deetergp, how did you take those incredible-looking screenshots that perfectly fit the window and include shadows?! |
@Julesssss When you try to do a normal screenshot(Shift + CMD + 4), instead of selecting the area which to capture, press Spacebar and it will highlight the entire window your cursor is at and when captured it adds the shadow! |
Thank you, this is much better than manually cropping screens. |
🚀 Deployed to staging by @marcaaron in version: 1.1.86-0 🚀
|
🚀 Deployed to production by @yuwenmemon in version: 1.1.86-5 🚀
|
Details
Test with https://github.com/Expensify/Web-Expensify/pull/34278
Fixed Issues
$ https://github.com/Expensify/Expensify/issues/218579
Tests
See QA steps. Test together with https://github.com/Expensify/Web-Expensify/pull/34278
PR Review Checklist
Contributor (PR Author) Checklist
### Fixed Issues
section aboveTests
sectionQA steps
sectiontoggleReport
and notonIconClick
)src/languages/*
filesSTYLE.md
) were followedAvatar
, I verified the components usingAvatar
are working as expected)/** comment above it */
displayName
propertythis
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)PR Reviewer Checklist
The Contributor+ will copy/paste it into a new comment and complete it after the author checklist is completed
### Fixed Issues
section aboveTests
sectionQA steps
sectiontoggleReport
and notonIconClick
).src/languages/*
filesSTYLE.md
) were followedAvatar
, I verified the components usingAvatar
have been tested & I retested again)/** comment above it */
displayName
propertythis
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)QA Steps