Closed lanitochka17 closed 1 month ago
In online, in IOU report for request money, the page keeps on loading
This is a feature request, I understand that we're trying to achieve 3 things below:
MoneyReportView
is rendered base on CREATED
action, we can generate a CREATE
action if the report is IOU report and the created actionn doesn't exist in ReportActionList
pendingAction
there as well and it will display at 50% opacity MoneyReportView
we can check if at least once transaction is pending we will set opacity for report total to 50%.For 1, an alternative is if there's no CREATED
report action, we can append it ourselves from the front-end, and later when we open the iou report and the real CREATED
report action comes, we can replace the appended one. But fixing from the back-end to additionally return CREATED
report action is more straight-forward and clean.
ReportActionsView
,
CREATED
action if the report is MoneyRequestReport and the last report action isn't the created action.getReportPreviewAction(props.report.chatReportID, props.report.reportID)
. Get the total request of IOU report via reportPreviewAction.childMoneyRequestCount
and filter reportActions
to get the number of IOU action in reportActions
. If it's equal do nothing. Otherwise, generates an amount of IOU actions equal to the total number of requests minus the number of IOU create actions currently in reportActions
by using buildOptimisticIOUReportAction
with random transactionID
. With random transactionID
, transaction data will be undefined, and then MoneyRequestPreview
will show skeleton as it is.const reportActionsToDisplay = useMemo(() => {
if (!ReportUtils.isMoneyRequestReport(props.report) || !_.size(props.reportActions) || !ReportActionsUtils.isCreatedAction(_.last(props.reportActions))) {
return props.reportActions;
}
const optimisticCreatedAction = ReportUtils.buildOptimisticCreatedReportAction(report.ownerAccountID, DateUtils.subtractMillisecondsFromDateTime(_.last(props.reportActions).created, 1));
return [...props.reportActions, optimisticCreatedAction];
}, [props.reportActions, props.report])
OPTIONAL: when generate the created action, we can add a flag to know this action is optimistic or not
reportActionsToDisplay
as sortedReportActions
prop hereProposals to review :)
Hi, Will review today just back from weekend
📣 It's been a week! Do we have any satisfactory proposals yet? Do we need to adjust the bounty for this issue? 💸
@abdulrahuman5196 how's the review going?
Hi, Will review again in my morning and update tomorrow
Checking now
@dukenv0307 Can you explain more on the first point? I am unable to understand this. What is this has to do with showing total from the IOU report data? And do double check the code pointer?
In OpenApp/ReconnectApp, we need to return the CREATED report action of the iou report as well, currently we only return 1 money request report action initially. Once we fix to add CREATED report action in the back-end, then the report total will show fine, according to this logic
@abdulrahuman5196 The total is displayed in MoneyRequestView
which is the created action of the IOU report. So in OpenApp
API, we should return the CREATED
action of the report to make this can be displayed when we force offline before we go to the IOU report. If not, skeleton will display when we go to this report in offline mode.
Issue not reproducible during KI retests. (First week)
@trjExpensify, @abdulrahuman5196 Whoops! This issue is 2 days overdue. Let's get this updated quick!
Issue not reproducible during KI retests. (First week)
I highly doubt this, It is not reproducible? Was it fixed somewhere?
The current bug is still reproducible.
I agree. How are we getting on with the proposal review @abdulrahuman5196?
📣 It's been a week! Do we have any satisfactory proposals yet? Do we need to adjust the bounty for this issue? 💸
I still need to test the first point from the explanation. Will update here once checked.
Reviewing again
@dukenv0307
The total is displayed in MoneyRequestView which is the created action of the IOU report. So in OpenApp API, we should return the CREATED action of the report to make this can be displayed when we force offline before we go to the IOU report. If not, skeleton will display when we go to this report in offline mode.
Got it on what you are mentioning. Currently we use the 'CREATED' type of reportAction to show the Total
header, but that is not loaded if we go to the money request page on offline case.
But the concern from OP was
We have the report total loaded in the iouReport data,
so we should show the report total in the report where possible when offline.
So, we should check if its possible to show the total amount header with Total
data used from other places(like iouReport data pointed in OP) apart from the CREATED type of reportAction.
We don't have proposal to approve. Requested existing proposal to see if we can have any other way as suggested here - https://github.com/Expensify/App/issues/26424#issuecomment-1825535407
@abdulrahuman5196 What is the problem with this case? I don't see the problem in this comment https://github.com/Expensify/App/issues/26424#issuecomment-1825535407 ? Can you explain in more detail on that?
@abdulrahuman5196 What is the problem with this case? I don't see the problem in this comment #26424 (comment) ? Can you explain in more detail on that?
The question was to, Instead of making BE change to return ReportAction of the 'CREATED' type on OpenApp, can we use other existing data source and display the header? As pointed in the OP. @dukenv0307
@abdulrahuman5196 This is the easiest way that we can do it, if not we should check all IOU
requests in the IOU report to re-calculate the possible total and I think this is not optimal. Additionally, that will break the logic which is used to show the created action.
@dukenv0307 No. You will already have the 'Total' data in the previous screens and I suppose report data will also be present. For example.
And also for MoneyRequestView we only provide the report
📣 It's been a week! Do we have any satisfactory proposals yet? Do we need to adjust the bounty for this issue? 💸
What's the latest here? @dukenv0307 are you making updates to the proposal or something else?
Will update tomorrow.
Issue not reproducible during KI retests. (Second week)
No. You will already have the 'Total' data in the previous screens and I suppose report data will also be present. For example.
@abdulrahuman5196 I know that it only uses report data but as I mentioned above, MoneyRequestView
is rendered as the created action of IOU report so I think it should be fixed in back-end to return created
action of IOU
report instead of the fixing workaround in front-end.
cc @mountiny @trjExpensify what do you think about this?
@dukenv0307 can you clarify what you mean exactly I see that we return created report action for expense/ iou reports
@mountiny To display total of iou report when we offline before open this report we should return created action in OpenApp
API.
the total is not stored in the created report action, maybe we talking about something else
@mountiny You're right but as I mentioned above it's displayed when ReportActionItem
is created action. The same with TaskView
, the data is stored in report.
Sorry is there some summary of the current problem?
Bump @dukenv0307 on @mountiny question!
@mountiny Yes the current problem here is for IOU report, MoneyRequestView
is displayed as the created action of this report so we need to return this in OpenApp
API.
@dukenv0307 I see, we cannot really do that until report pagination is implemented so different solution should be looked into
📣 It's been a week! Do we have any satisfactory proposals yet? Do we need to adjust the bounty for this issue? 💸
@dukenv0307 let us know your thoughts on an alt!
@mountiny Since TaskView
, MoneyRequestView
, and MoneyReportView
only depend on report
data and shouldShowHorizontalRule
, we can move this into ReportActionList
before here. And in ReportActionItem
we will not display these view if the action is created
action.
Lets make a formal proposal and let @abdulrahuman5196 review it
@abdulrahuman5196 Updated propsal with another solution for first point. Please help to review again.
Issue not reproducible during KI retests. (third week)
@abdulrahuman5196 can you review this please? https://github.com/Expensify/App/issues/26424#issuecomment-1842864977
📣 It's been a week! Do we have any satisfactory proposals yet? Do we need to adjust the bounty for this issue? 💸
@dukenv0307 The updated point 1 in the proposal will cause a larger code refractor right? Or is it a considerable change?
Could you provide some high level information on the changes required as per the updated proposal?
@abdulrahuman5196 In the second thought, I think it's impossible to bring MoneyReportView
component to the high level because although this component only depends on report
data, the wrap component of this depends on reportAction
and move MoneyReportView
to the higher component will make the height of list report action is less than.
Got it. Let me also give a check on current code base to check the feasibility.
@trjExpensify, @abdulrahuman5196 Uh oh! This issue is overdue by 2 days. Don't forget to update your issues!
Will check and update on this today https://github.com/Expensify/App/issues/26424#issuecomment-1855793632
Reviewing now
If you haven’t already, check out our contributing guidelines for onboarding and email contributors@expensify.com to request to join our Slack channel!
Action Performed:
Expected Result:
Output of @mountiny & I discussing this one here for reference.
Actual Result:
In online, in IOU report for request money, the page keeps on loading
Workaround:
Unknown
Platforms:
Which of our officially supported platforms is this issue occurring on?
Version Number: 1.3.60-1
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/b3257238-8c59-4e60-a84b-8dce2d6bc3cf
Expensify/Expensify Issue URL:
Issue reported by: Applause - Internal team
Slack conversation:
View all open jobs on GitHub
Upwork Automation - Do Not Edit
Issue Owner
Current Issue Owner: @trjExpensify