You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
{{ message }}
Repository navigation
[HOLD for payment 2024-08-02] [$250] Expense - Title field is not grayed out when edited offline #45072
Awaiting PaymentAuto-added when associated PR is deployed to productionBugSomething is broken. Auto assigns a BugZero manager.DailyKSv2ExternalAdded to denote the issue can be worked on by a contributor
Version Number: 9.0.5-7 Reproducible in staging?: Y Reproducible in production?: Y If this was caught during regression testing, add the test name, ID and link from TestRail: N/A Issue reported by: Applause - Internal Team
Please re-state the problem that we are trying to solve in this issue.
Title field is not grayed out when edited offline
What is the root cause of that problem?
When updating title we add pending action to report.pedingFields.reportName. But
we are passing only report.pendingFields?.[fieldKey] to pendingAction of report title here
What changes do you think we should make in order to solve the problem?
We should simply get the pending action and error using reportName because this the key used to set the pending action and error in ONYX.
We also need to create a new util function to clear the errors for reportName key or we can update clearReportFieldErrors to accept a new param for fieldKey and use that instead if present. And when calling Report.clearReportNameErrors(report.reportID, titleField, 'reportName') for title we will pass fieldKey as reportName.
Alternatively we can accept third param reportName as boolean and use that to determine fieldKey in clearReportFieldErrors.
so the title field is not grayed out when edited offline.
What changes do you think we should make in order to solve the problem?
We should get the pendingAction base on both report.pendingFields?.[fieldKey] and report.pendingFields.reportName because:
report.pendingFields?.['text_title']: This data is the pending state of the report.fieldList.['text_title']. It will affect how we display the report title. If the report.fieldList.['text_title'].deletable is true, so we can display the report title as editable and vice versa. That is what we handled in the below logic:
changed the title [-]Expense - Title field is not grayed out when edited offline[/-][+][$250] Expense - Title field is not grayed out when edited offline[/+]on Jul 11, 2024
The solution for this issue has been 🚀 deployed to production 🚀 in version 9.0.12-0 and is now subject to a 7-day regression period 📆. Here is the list of pull requests that resolve this 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] The PR that introduced the bug has been identified. Link to the PR:
[@fedirjh] The offending PR has been commented on, pointing out the bug it caused and why, so the author and reviewers can learn from the mistake. Link to comment:
[@fedirjh] A discussion in #expensify-bugs has been started about whether any other steps should be taken (e.g. updating the PR review checklist) in order to catch this type of bug sooner. Link to discussion:
[@fedirjh] Determine if we should create a regression test for this bug.
[@fedirjh] If we decide to create a regression test for the bug, please propose the regression test steps to ensure the same bug will not reach production again.
[@miljakljajic] Link the GH issue for creating/updating the regression test once above steps have been agreed upon:
Link to comment: Author is aware and has fixed the bug
Link to discussion: N/A This should have been caught during testing, we have a checklist item for this case
Determine if we should create a regression test for this bug: Yes
Regression Test Proposal
1. Go to workspace chat
2. Submit an expense
3. Click on the expense preview
4. Go offline
5. Click on the report header
6. Click Title field
7. Edit the title and save it
8. Confirm it changed it's state to reflect being changed in offline mode to be greyed out
Awaiting PaymentAuto-added when associated PR is deployed to productionBugSomething is broken. Auto assigns a BugZero manager.DailyKSv2ExternalAdded to denote the issue can be worked on by a contributor
Activity
melvin-bot commentedon Jul 9, 2024
Triggered auto assignment to @miljakljajic (
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.etCoderDysto commentedon Jul 9, 2024
Proposal
Please re-state the problem that we are trying to solve in this issue.
Title field is not grayed out when edited offline
What is the root cause of that problem?
When updating title we add pending action to
report.pedingFields.reportName. Butwe are passing only
report.pendingFields?.[fieldKey]to pendingAction of report title hereApp/src/pages/ReportDetailsPage.tsx
Lines 597 to 599 in 9c32293
What changes do you think we should make in order to solve the problem?
we should add
report?.pendingFields?.reportNameto pendingAction tooWhat alternative solutions did you explore? (Optional)
Result:
Screen.Recording.2024-07-09.at.4.29.07.in.the.afternoon.mp4
Krishna2323 commentedon Jul 9, 2024
Proposal
Please re-state the problem that we are trying to solve in this issue.
Expense - Title field is not grayed out when edited offline
What is the root cause of that problem?
We are trying to access the report pending action using
fieldKeywhich is incorrect.App/src/pages/ReportDetailsPage.tsx
Lines 598 to 603 in 87fdc79
What changes do you think we should make in order to solve the problem?
reportNamebecause this the key used to set the pending action and error in ONYX.reportNamekey or we can updateclearReportFieldErrorsto accept a new param forfieldKeyand use that instead if present. And when callingReport.clearReportNameErrors(report.reportID, titleField, 'reportName')for title we will passfieldKeyasreportName.reportNameas boolean and use that to determinefieldKeyinclearReportFieldErrors.App/src/libs/actions/Report.ts
Lines 1820 to 1830 in 87fdc79
What alternative solutions did you explore? (Optional)
dominictb commentedon Jul 10, 2024
Proposal
Please re-state the problem that we are trying to solve in this issue.
What is the root cause of that problem?
App/src/pages/ReportDetailsPage.tsx
Lines 624 to 627 in c973e62
with the
pendingAction={report.pendingFields?.[fieldKey]}in this casefieldKeyistext_title. But when the title field is updated, we only set:App/src/libs/actions/Report.ts
Lines 1770 to 1772 in 8ee4c92
so the title field is not grayed out when edited offline.
What changes do you think we should make in order to solve the problem?
pendingActionbase on bothreport.pendingFields?.[fieldKey]andreport.pendingFields.reportNamebecause:report.pendingFields?.['text_title']: This data is the pending state of thereport.fieldList.['text_title']. It will affect how we display the report title. If thereport.fieldList.['text_title'].deletableistrue, so we can display the report title as editable and vice versa. That is what we handled in the below logic:App/src/pages/ReportDetailsPage.tsx
Line 613 in c973e62
Also, in OD, we can change the
report.fieldList.['text_title']data, so I am pretty sure that we will allow users to do it in ND in the future.report.pendingFields.reportName: This data is the pending state of thereport.reportName.As we can we, both of them affect how the report title is displayed.
So the change is to update:
App/src/pages/ReportDetailsPage.tsx
Line 626 in c973e62
to:
We can apply the same change to the errors field:
App/src/pages/ReportDetailsPage.tsx
Line 627 in c973e62
Then we should update:
App/src/pages/ReportDetailsPage.tsx
Line 630 in c973e62
to:
with:
What alternative solutions did you explore? (Optional)
melvin-bot commentedon Jul 11, 2024
Job added to Upwork: https://www.upwork.com/jobs/~01ef7d62e69d5030af
[-]Expense - Title field is not grayed out when edited offline[/-][+][$250] Expense - Title field is not grayed out when edited offline[/+]melvin-bot commentedon Jul 11, 2024
Triggered auto assignment to Contributor-plus team member for initial proposal review - @fedirjh (
External)37 remaining items
melvin-bot commentedon Jul 26, 2024
The solution for this issue has been 🚀 deployed to production 🚀 in version 9.0.12-0 and is now subject to a 7-day regression period 📆. Here is the list of pull requests that resolve this issue:
If no regressions arise, payment will be issued on 2024-08-02. 🎊
For reference, here are some details about the assignees on this issue:
melvin-bot commentedon Jul 26, 2024
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 commentedon Aug 2, 2024
BugZero Checklist:
Regression Test Proposal
github-actions commentedon Aug 2, 2024
true
JmillsExpensify commentedon Aug 5, 2024
@miljakljajic payment summary when you get a chance.
miljakljajic commentedon Aug 5, 2024
@fedirjh is owed 250 for their work reviewing this issue
JmillsExpensify commentedon Aug 5, 2024
$250 approved for @fedirjh
dominictb commentedon Aug 6, 2024
@miljakljajic I'm also due payment here as the PR uses my proposal.
@aldo-expensify Also confirmed it above.
I've accepted the Upwork offer for the job.
miljakljajic commentedon Aug 7, 2024
Paid you too @dominictb , thank you!