Closed lanitochka17 closed 1 year ago
Triggered auto assignment to @tjferriss (Bug
), see https://stackoverflow.com/c/expensify/questions/14418 for more details.
Platforms
in OP are ✅)Chat - Infinite loading after selecting flag option offline
When we open report isLoadingReportAction is true https://github.com/Expensify/App/blob/21d14c5135d186f2f3ba9dc0e8d53f071d43f80d/src/libs/actions/Report.js#L397
In flag comment this make this condition true hence the instead of page we have a loading indicator https://github.com/Expensify/App/blob/21d14c5135d186f2f3ba9dc0e8d53f071d43f80d/src/pages/FlagCommentPage.js#L160
Solution 1:
We can remove props.report.isLoadingReportActions
from here
https://github.com/Expensify/App/blob/21d14c5135d186f2f3ba9dc0e8d53f071d43f80d/src/pages/FlagCommentPage.js#L160
Or we can use &&
instead of ||
Selecting flag option shows infinite loading in offline mode
We're showing Loader
here
https://github.com/Expensify/App/blob/be7b6a09cde880cd96470e4e9e0c2f921499dd20/src/pages/FlagCommentPage.js#L150-L153
We set report.isLoadingReportActions
to true when we open report and set isLoadingReportData
when we reconnect app.
In offline mode, openReport API isn't called but isLoadingReportActions
is set optimistically. That's why we see the infinite loader.
This is from this PR
We have reportID and reportActionID(from the route). I think we should be able to flag comments as long as we have corresponding report and reportAction.
So I suggest to remove the above code completely(L150-L153)
This works as expected.
Chat - Infinite loading after selecting flag option offline
Let's see the condition to display FullscreenLoadingIndicator https://github.com/Expensify/App/blob/5419d9ba7bb33347160ff20fc061e48d914eac6e/src/pages/FlagCommentPage.js#L160-L163
We are setting isLoadingReportActions: true in optimisticData of openReport API https://github.com/Expensify/App/blob/5419d9ba7bb33347160ff20fc061e48d914eac6e/src/libs/actions/Report.js#L397 but when offline the API is not sent so both successData and failureData are not updated. So, isLoadingReportActions still be true
https://github.com/Expensify/App/blob/5419d9ba7bb33347160ff20fc061e48d914eac6e/src/pages/FlagCommentPage.js#L160-L163 We need to show loadingPage here because in case the user access to FlagCommentPage by link, then there are 2 scenarios
This is the reason why we need to show loadingPage while we wait for data and decide which scenario happen We only should show FullscreenLoadingIndicator if report is empty and isLoadingReportData is true or if reportActions is empty and isLoadingReportActions is true. Update like this code
const shouldShowLoading = (props.isLoadingReportData && isEmpty(props.report) || (isEmpty(props.reportActions) && props.report.isLoadingReportActions)
Access to FlagCommentPage by link only happens while the user is online so I suggest we only should show FullscreenLoadingIndicator while online, update like this code
const shouldShowLoading = (props.isLoadingReportData || props.report.isLoadingReportActions) && !props.network.isOffline
Job added to Upwork: https://www.upwork.com/jobs/~01d1f8e9ce942eb648
Current assignee @tjferriss is eligible for the External assigner, not assigning anyone new.
Triggered auto assignment to Contributor-plus team member for initial proposal review - @fedirjh (External
)
Infinite loading after selecting flag option offline.
The root cause of this issue is that
isLoadingReportActions
to true when open a reportisLoadingReportActions
of the report remains true, so following snippet will show the infinite loadingThe expected behaviours should be
isLoadingReportData
is true, we should show loading indicator FullPageNotFoundView
To achieve it, we can
Remove following snippet
Change this line
to
<FullPageNotFoundView shouldShow={_.isEmpty(props.report) || _.isEmpty(getActionToFlag()) || !ReportUtils.shouldShowFlagComment(getActionToFlag(), props.report)}>
Add
withReportOrNotFound,
below this line
and remove
The usage of withReportOrNotFound
and FullPageNotFoundView
is similar to SplitBillDetailsPage.js
N/A
@tjferriss, @fedirjh Whoops! This issue is 2 days overdue. Let's get this updated quick!
Reviewing shortly.
Chat - Infinite loading after selecting flag option offline
FullscreenLoadingIndicator on the FlagCommentPage is not handling the scenario where the user is offline and the API call is not sent. Specifically, when the user is offline, the API call to update the report actions is not made, and as a result, the isLoadingReportActions flag remains true, causing the loading indicator to persist indefinitely.
Update the condition for shouldShowLoading to consider the scenario where the user is offline and the API call is not made. We should show the loadingPage when either of the following conditions is true: a. isLoadingReportData is true, and the report data is empty (props.isLoadingReportData && isEmpty(props.report)) b. isLoadingReportActions is true, and the reportActions data is empty (isEmpty(props.reportActions) && props.report.isLoadingReportActions)
To address the scenario where the user accesses the FlagCommentPage by link while online, show the FullscreenLoadingIndicator only when the user is online. Update the condition to include a check for the network status: (props.isLoadingReportData || props.report.isLoadingReportActions) && !props.network.isOffline
@tjferriss, @fedirjh Whoops! This issue is 2 days overdue. Let's get this updated quick!
Easy, MelvinBot. @fedirjh is reviewing proposals.
📣 It's been a week! Do we have any satisfactory proposals yet? Do we need to adjust the bounty for this issue? 💸
@dukenv0307 It seems to be a regression from your PR, I have raised a question in the PR about the FullscreenLoadingIndicator
, Can you please share any inputs on why it was implemented?
@fedirjh I replied in the PR. Can you check again.
@fedirjh The fix that I mentioned in the PR is my proposal of this issue. What do you think about it?
This will not work in offline mode when we do something to make the
openReport
API is called
@dukenv0307 This doesn’t looks like a valid use case.
@fedirjh In offline the API will be added in the queue, when openAPI is added in the queue optimisticData is merged in Onyx that makes isLoadingReportAction is true and then this issue occurs.
In offline the API will be added in the queue, when openAPI is added in the queue optimisticData is merged in Onyx that makes isLoadingReportAction is true and then this issue occurs.
Are we sure we are referring to the same thing? Regardless of the API call, when we are offline, we have persisted data in Onyx, we should check that data instead of awaiting new data.
This will not work in offline mode when we do something to make the
openReport
API is called
Can you list a valid use case? why it will not work in offline mode?
This will not work in offline mode when we do something to make the openReport API is called
@fedirjh
I mean the old check that I added in the PR will not work in offline when the openReport API is added in the queue and we should change the check like this
const shouldShowLoading = (props.isLoadingReportData && isEmpty(props.report)) || (isEmpty(props.reportActions) && props.report.isLoadingReportActions)
we should check that data instead of awaiting new data.
We should keep the check props.isLoadingReportData
and isEmpty(props.reportActions)
because If the reportID or reportActionID is not found the page will load infinite because both report and reportAction data is empty.
We should keep the check props.isLoadingReportData and isEmpty(props.reportActions) because If the reportID or reportActionID is not found the page will load infinite because both report and reportAction data is empty.
We shouldn’t use the FullscreenLoadingIndicator
, that was my first question , if we have data then we display the component else we display the not found view.
We shouldn’t use the FullscreenLoadingIndicator
@fedirjh We have a problem when we do not use FullscreenLoadingIndicator
like this video. The page not found will display for first because the report and reportAction is loading from the API.
@dukenv0307 I think we have the WithReportOrNotFound
HOC for that purpose ?
@fedirjh This HOC is not enough because we also need to wait reportAction data to display not found page or flag page correctly.
This HOC is not enough because we also need to wait reportAction data to display not found page or flag page correctly.
Isn’t the report
and reportActions
loaded in the same request ? Have we implemented the pagination yet ?
Report data will be not empty in API openApp
and reportAction is loaded in openReport
API
Thanks everyone for the proposals, it looks like we should proceed with @dukenv0307's proposal. We should display the FullscreenLoadingIndicator
when there is no data in Onyx
and we are loading the report.
🎀 👀 🎀 C+ reviewed
Triggered auto assignment to @srikarparsi, see https://stackoverflow.com/c/expensify/questions/7972 for more details.
@fedirjh Thanks for reviewing proposals. Can I have your feedback about my proposal.
I think it makes sense to display the not found page if report action is not yet in Onyx
regarding the data flow guides. The not found page will be updated to flag page if openReport
API return new report action data. The transition should be expected right?
If we access by deep link of the flag page, like http://localhost:8082/flag/8132130769751654/3782505051996183681
there're following cases to be considered
OpenApp
or ReconnectApp
API is called where the optimistic isLoadingReportData
is set to true
8132130769751654
exists in Onyx
or not3782505051996183681
exists in Onyx
or notReportUtils.shouldShowFlagComment
or notThanks for reviewing proposals. Can I have your feedback about my https://github.com/Expensify/App/issues/23125#issuecomment-1643567134.
@eh2077 Your proposal doesn’t cover the case when we don't have report action and we deep link, it will display 'not found' view for a brief moment before rendering the flag comment component and that's not expected.
The transition should be expected right?
Nope, it doesn’t make sense to display not found
then found
, it should be loading
then found
or not found
. The expected transition is that we display a skeleton view until the data is loaded and given that we have not implemented that yet, we should display the loading indicator.
Looks good to me as well, thanks @fedirjh and @dukenv0307!
📣 @fedirjh 🎉 An offer has been automatically sent to your Upwork account for the Reviewer role 🎉 Thanks for contributing to the Expensify app!
📣 @dukenv0307 🎉 An offer has been automatically sent to your Upwork account for the Contributor role 🎉 Thanks for contributing to the Expensify app!
Offer link Upwork job Please accept the offer and leave a comment on the Github issue letting us know when we can expect a PR to be ready for review 🧑💻 Keep in mind: Code of Conduct | Contributing 📖
@fedirjh The PR is ready for review.
Update: We are currently facing a similar issue that also impacts the split bill detail page #23568. In this PR, we plan to introduce a new HOC named withReportAndReportActionOrNotFound
. This HOC will contain the same code as the one mentioned in this issue. To prevent redundant code, we will hold the PR until the new HOC is created, and then we will use it within the FlagCommentPage
page.
Based on my calculations, the pull request did not get merged within 3 working days of assignment. Please, check out my computations here:
On to the next one 🚀
@fedirjh @srikarparsi This PR is on hold from August 1 to August 4. So I think we are eligible for a bonus timeline
Reviewing
label has been removed, please complete the "BugZero Checklist".
The solution for this issue has been :rocket: deployed to production :rocket: in version 1.3.52-5 and is now subject to a 7-day regression period :calendar:. Here is the list of pull requests that resolve this issue:
If no regressions arise, payment will be issued on 2023-08-17. :confetti_ball:
After the hold period is over and BZ checklist items are completed, please complete any of the applicable payments for this issue, and check them off once done.
For reference, here are some details about the assignees on this issue:
As a reminder, here are the bonuses/penalties that should be applied for any External issue:
BugZero Checklist: The PR fixing this issue has been merged! The following checklist (instructions) will need to be completed before the issue can be closed:
@fedirjh and @dukenv0307 are both hired in Upworks: https://www.upwork.com/ab/applicants/1681531600613777408/hired. We're waiting on the regression period now.
@fedirjh can you get started on the checklist when you have a minute?
[x] Link to the PR: https://github.com/Expensify/App/pull/21771
[x] Link to comment: https://github.com/Expensify/App/pull/21771#discussion_r1276124494
[x] Link to discussion: N/A There was a recently added checklist item that could help catch this bug earlier.
- [ ] If the PR modifies a component or page that can be accessed by a direct deeplink, I verified that the code functions as expected when the deeplink is used - from a logged in and logged out account.
[x] Determine if we should create a regression test for this bug: yes
Regression Test Proposal
Do we agree 👍 or 👎
The payments have been sent via Upworks and QA issue created.
@tjferriss Can you please check my comment above https://github.com/Expensify/App/issues/23125#issuecomment-1669039819.
@dukenv0307 yes, that looks right. I've paid the bonus to both of you via Upworks.
If you haven’t already, check out our contributing guidelines for onboarding and email contributors@expensify.com to request to join our Slack channel!
Issue found when executing PR https://github.com/Expensify/App/pull/22771
Action Performed:
Precondition: user is logged in on two platforms with different accounts
Expected Result:
The reasons for flagging are displayed
Actual Result:
Infinite loading when selecting "Flag as offensive"
Workaround:
Unknown
Platforms:
Which of our officially supported platforms is this issue occurring on?
Version Number: 1.3.42.18
Reproducible in staging?: Yes
Reproducible in production?: Yes
If this was caught during regression testing, add the test name, ID and link from TestRail:
Email or phone of affected tester (no customers):
Logs: https://stackoverflow.com/c/expensify/questions/4856
Notes/Photos/Videos: Any additional supporting documentation
https://github.com/Expensify/App/assets/78819774/bfd625d0-0c20-4403-b2ab-0107e4888f31
Expensify/Expensify Issue URL:
Issue reported by: Applause - Internal Team
Slack conversation:
Upwork Automation - Do Not Edit