Open IuliiaHerets opened 1 month ago
Triggered auto assignment to @puneetlath (DeployBlockerCash
), see https://stackoverflowteams.com/c/expensify/questions/9980/ for more details.
Triggered auto assignment to @VictoriaExpensify (Bug
), see https://stackoverflow.com/c/expensify/questions/14418 for more details. Please add this bug to a GH project, as outlined in the SO.
:wave: Friendly reminder that deploy blockers are time-sensitive ⏱ issues! Check out the open `StagingDeployCash` deploy checklist to see the list of PRs included in this release, then work quickly to do one of the following:
We think that this bug might be related to #vip-vsb
Agree this is an issue and we should fix it.
Job added to Upwork: https://www.upwork.com/jobs/~0185bccf1e3226865f
Triggered auto assignment to Contributor-plus team member for initial proposal review - @dukenv0307 (External
)
Report Fields are part of Wave_Control, so I'm adding this issue to that project
Report Fields are behind a beta, so i'm demoting this one
Edited by proposal-police: This proposal was edited at 2024-08-13 08:42:12 UTC.
The "Required" error message does not trigger for the Report Field on the second submitted expense when auto-filled.
When we create an expense report, the fieldList
is assigned as the fieldList
of the policy.
Then because the field has default value is empty, a report violation is added here. https://github.com/Expensify/App/blob/420c2a13cc176dca5adf8dcc8132ef5f8ff678f7/src/libs/actions/IOU.ts#L480-L486
After BE returns the data, this field is auto-filled but the report violation isn't cleared then the error still appears
When we create an expense report here, we should auto-fill the report field from the last paid expense report of this policy expense chat (we can confirm the logic from BE).
const reportActions = allReportActions?.[`${ONYXKEYS.COLLECTION.REPORT_ACTIONS}${chatReportID}`] ?? {};
const lastSettledReportPreviewAction = Object.values(reportActions)
.filter((action) => ReportActionsUtils.isReportPreviewAction(action) && isSettled(action.childReportID))
.sort((a, b) => {
if (a.created < b.created) {
return -1;
}
return 1;
})
?.at(-1);
const lastSettedExpenseReport = getReportOrDraftReport(lastSettledReportPreviewAction?.childReportID);
expenseReport.fieldList = lastSettedExpenseReport?.fieldList ?? policy?.fieldList;
return expenseReport;
Then the violation will not appear here since the value already exists https://github.com/Expensify/App/blob/420c2a13cc176dca5adf8dcc8132ef5f8ff678f7/src/libs/actions/IOU.ts#L480-L486
If the violation isfieldRequired
and the value exists we should return an empty string here
and should not display a red dot here https://github.com/Expensify/App/blob/420c2a13cc176dca5adf8dcc8132ef5f8ff678f7/src/components/ReportActionItem/MoneyReportView.tsx#L122
@nkdengineer Your solution makes sense to me. Can you pls share the detail implementation? Thanks
@dukenv0307 Update my proposal with implementation detail. We can confirm with the internal team about this logic and the BE logic.
We can confirm with the internal team about this logic and the BE logic.
@puneetlath can you help check the concern above? Thanks
It feels to me like this is working as expected. But confirming here: https://expensify.slack.com/archives/C06ML6X0W9L/p1723746405468429
@puneetlath The problem here is I want to know how BE auto-fill the report field for an expense report when we create an expense. So I can do this in optimistic data to prevent the incorrect report violation in optimistic data.
@puneetlath, @VictoriaExpensify, @dukenv0307 Whoops! This issue is 2 days overdue. Let's get this updated quick!
@nkdengineer we are still discussing this one. It seems like the report fields should be sticky between the reports but when I tried on OldDot, it was not sticky. Can you try as well what is the different behaviour between NewDot and OldDot in this flow? Thanks!
@mountiny I tested in OldDot, it was sticky
https://github.com/user-attachments/assets/e2d9e0a2-6415-476f-85b2-cfba197181f2
@nkdengineer what if you create a new workspace and report and set up the report fields in oldDot solely (sorry mobile today so cant test myself) - i think that was the flow where i got no stickiness
📣 It's been a week! Do we have any satisfactory proposals yet? Do we need to adjust the bounty for this issue? 💸
@puneetlath, @VictoriaExpensify, @dukenv0307 Still overdue 6 days?! Let's take care of this!
what if you create a new workspace and report and set up the report fields in oldDot solely (sorry mobile today so cant test myself) - i think that was the flow where i got no stickiness
@mountiny I tested this case and the new report is also auto-filled by previous paid expense report after we paid an expense report.
It sounds like everything is working correctly then, is that right?
@puneetlath Yes BE is working correctly but we need to update the optimistic data in front-end to prevent incorrect violation is displayed.
The problem here is I want to know how BE auto-fill the report field for an expense report when we create an expense. So I can do this in optimistic data to prevent the incorrect report violation in optimistic data.
Can you check my concern above?
cc @mountiny
@puneetlath, @VictoriaExpensify, @dukenv0307 Now this issue is 8 days overdue. Are you sure this should be a Daily? Feel free to change it!
@nkdengineer Yes you are right, we need to update the optimistic case, althouhg I wonder if we have all the data for this available when user signs out and signs back in, can you check that and make a proposal for that case?
Not overdue
📣 It's been a week! Do we have any satisfactory proposals yet? Do we need to adjust the bounty for this issue? 💸
@nkdengineer are you able to look into this one further after my latest comment?
I'm checking this by testing some cases with many report previews. Will give an update tomorrow.
@puneetlath @mountiny @VictoriaExpensify @dukenv0307 this issue was created 2 weeks ago. Are we close to approving a proposal? If not, what's blocking us from getting this issue assigned? Don't hesitate to create a thread in #expensify-open-source to align faster in real time. Thanks!
@mountiny I checked, and sometimes the last paid expense report doesn't exist when we logout and login again. Can we return the fieldList
of the last paid expense report in the data of policyExpenseChat report like the iouReportID
field that is the last unsettled expense report?
Hmm I am not sure if this is really a feasible approach for us. Is there a way we could just avoid showing the optimistic violation rather and wait for the onyx data to come from the backend to only then show this violation @nkdengineer
@mountiny Yeah we can prevent adding the report violation in optimistic data when we create a new expense report. What do you think?
could we do both:
@puneetlath, @mountiny, @VictoriaExpensify, @dukenv0307 Whoops! This issue is 2 days overdue. Let's get this updated quick!
detect we have the fieldList data we need to potentially show the optimistic violation and show it
@mountiny I think it's hard to detect, for example, we cannot know if the paid expense report is the latest or not or cannot know if we have the paid or not because in OpenApp
API, the data may not contain all REPORTPREVIEW
actions or expense reports of the policy expense chat
@nkdengineer Yeah this is not easy thing to resolve. I need to think about this more. What would you propose now to handle this gracefully without adding any more data from backend?
Not overdue
What would you propose now to handle this gracefully without adding any more data from backend?
@mountiny I propose to not add field violation to optimistic data here if we create a new expense report.
@nkdengineer Are none of the reliably computable optimistically? I agree it might be cleaner to not show this optimistically as they can be complex and wait for backend
Are none of the reliably computable optimistically? I agree it might be cleaner to not show this optimistically as they can be complex and wait for backend
@mountiny Yes, only when we edit the report field we can computable the optimistic data correctly because in this case, we can know exactly the value of report field.
📣 It's been a week! Do we have any satisfactory proposals yet? Do we need to adjust the bounty for this issue? 💸
I think to fix this properly we would need to load all this data in OpenApp - which means the latest paid report fieldList for all control policies user is member of. I think that is something we should not add as it could slow down already stretched OpenApp call.
So i would vote to not create these optimistically as often the user wont have this data available when they sign in and create a new report. @puneetlath do you have any concerns about that?
@puneetlath, @mountiny, @VictoriaExpensify, @dukenv0307 Eep! 4 days overdue now. Issues have feelings too...
Could we get it when opening the report instead of when opening the app?
Could we get it when opening the report instead of when opening the app?
We can create the money request via FAB without opening the report.
We can create the money request via FAB without opening the report.
+1
Ahh ok, sorry I didn't correctly understand. Would it be possible to create them optimistically if we have the data, but don't create them optimistically if we don't?
Otherwise, what you suggest makes sense to me.
Not overdue
If you haven’t already, check out our contributing guidelines for onboarding and email contributors@expensify.com to request to join our Slack channel!
Version Number: v9.0.19-0 Reproducible in staging?: Y Reproducible in production?: N Email or phone of affected tester (no customers): abebemiherat@gmail.com Issue reported by: Applause Internal Team
Action Performed:
Expected Result:
The "Required" error message should not appear if the Report Field in the second expense is auto-filled with information from the first expense.
Actual Result:
The "Required" error message does not trigger for the Report Field on the second submitted expense when auto-filled.
Workaround:
Unknown
Platforms:
Screenshots/Videos
https://github.com/user-attachments/assets/69cc30dc-7e05-47f5-a160-6bc73c415c73
View all open jobs on GitHub
Upwork Automation - Do Not Edit
Issue Owner
Current Issue Owner: @dukenv0307