-
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
Fix infinite loading in Flag page in offline #23775
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
openApp
API is completeprops.report.isLoadingReportAction
for now isundefined
becauseopenReport
isn't called. - _.isEmpty(props.reportActions) to wait
oenReport
API is called. But sometimes, props.reportActions is not empty by another api that isreadOldestAction
andprops.reportActions
doesn'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 |
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
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 Issues
section aboveTests
sectionOffline steps
sectionQA steps
sectiontoggleReport
and notonIconClick
)myBool && <MyComponent />
.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.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
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