-
Notifications
You must be signed in to change notification settings - Fork 3.5k
Fix infinite loading in Flag page in offline #23775
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
Conversation
|
@fedirjh In this issue #23568 (comment) we decided to create new HOC for the page need both report and reportAction data. So we can hold this PR until the PR in #23568 is complete to re-use the HOC here. |
src/pages/FlagCommentPage.js
Outdated
| const isLoadingInitialReport = props.isLoadingReportData && _.isEmpty(props.report); | ||
| const isLoadingInitialReportActions = _.isEmpty(props.reportActions) || (props.report.isLoadingReportActions && _.isEmpty(getActionToFlag())); | ||
| const isExistReport = isLoadingInitialReport || (!_.isEmpty(props.report) && !!props.report.reportID); | ||
|
|
||
| const shouldShowLoading = (isLoadingInitialReport || isLoadingInitialReportActions) && isExistReport; |
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.
@dukenv0307 Can you explain the changes? why we didn’t just update the line to
const shouldShowLoading = (props.isLoadingReportData && isEmpty(props.report) || (isEmpty(props.reportActions) && props.report.isLoadingReportActions) 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.
- when
openAppAPI is completeprops.report.isLoadingReportActionfor now isundefinedbecauseopenReportisn't called. - _.isEmpty(props.reportActions) to wait
oenReportAPI is called. But sometimes, props.reportActions is not empty by another api that isreadOldestActionandprops.reportActionsdoesn't contain reportAction with reportActionID param. That is the reason we should check reportAction likeisLoadingInitialReportActions - if report doesn't exist we don't need to check any thing else that is
isExistReport - Because split bill page also has both reportID and reportActionID in param, so we decided to create a new HOC to use for two pages and we can use this in the further. We can see the implement for HOC in this PR Fix crash app when opening split bill detail page by deep link #23977
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.
Since we will implement HOC in the other PR, let's hold this PR, then use the same HOC in this component.
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.
Do we need to change the title of this 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 so, I will leave a note inside the linked issue.
|
cc @dukenv0307, Let's continue with this PR, we shouldn’t merge it until #23977 is deployed to production. |
|
@fedirjh Updated the PR with the new HOC. |
|
@fedirjh Bump |
Reviewer Checklist
Screenshots/VideosWebCleanShot.2023-08-07.at.13.17.31.mp4Mobile Web - ChromeCleanShot.2023-08-07.at.16.07.01.mp4Mobile Web - SafariCleanShot.2023-08-07.at.15.38.50.mp4DesktopCleanShot.2023-08-07.at.15.28.35.mp4iOSCleanShot.2023-08-07.at.15.36.07.mp4AndroidCleanShot.2023-08-07.at.16.23.45.mp4 |
fedirjh
left a comment
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 good to me.
🎀 👀 🎀 C+ reviewed
srikarparsi
left a comment
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.
lgtm as well!
|
✋ 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/srikarparsi in version: 1.3.52-0 🚀
|
|
🚀 Deployed to staging by https://github.com/srikarparsi in version: 1.3.52-0 🚀
|
|
🚀 Deployed to production by https://github.com/puneetlath in version: 1.3.52-5 🚀
|
Details
In offline mode, sometimes the flag page shows loading infinitely. We need to change the condition show loading to fix it
Fixed Issues
$ #23125
PROPOSAL: #23125 (comment)
Tests
Offline tests
Same as above
QA Steps
PR Author Checklist
### Fixed Issuessection aboveTestssectionOffline stepssectionQA stepssectiontoggleReportand notonIconClick)myBool && <MyComponent />.src/languages/*files and using the translation methodWaiting for Copylabel for a copy review on the original GH to get the correct copy.STYLE.md) were followedAvatar, I verified the components usingAvatarare working as expected)/** comment above it */thisproperly so there are no scoping issues (i.e. foronClick={this.submit}the methodthis.submitshould be bound tothisin the constructor)thisare necessary to be bound (i.e. avoidthis.submit = this.submit.bind(this);ifthis.submitis never passed to a component event handler likeonClick)StyleUtils.getBackgroundAndBorderStyle(themeColors.componentBG))Avataris modified, I verified thatAvataris working as expected in all cases)ScrollViewcomponent to make it scrollable when more elements are added to the page.mainbranch was merged into this PR after a review, I tested again and verified the outcome was still expected according to theTeststeps.Screenshots/Videos
Web
Screencast.from.28-07-2023.10.41.29.webm
Mobile Web - Chrome
Record_2023-07-28-10-44-04.mp4
Mobile Web - Safari
safari_cp.mp4
Desktop
desktop.2.mp4
iOS
ios.mov
Android
android.mp4