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 2025-01-24] [$250] Report fields -System message shows undefined when list value is changed back to initial value #47067
Awaiting PaymentAuto-added when associated PR is deployed to productionBugSomething is broken. Auto assigns a BugZero manager.DailyKSv2DesignExternalAdded to denote the issue can be worked on by a contributor
Version Number: v9.0.18-1 Reproducible in staging?: Y Reproducible in production?: Y Email or phone of affected tester (no customers):applausetester+kh050806@applause.expensifail.com Issue reported by: Applause Internal Team
Action Performed:
Go to staging.new.expensify.com
Go to workspace chat.
Submit two expenses.
Go to workspace settings > Report fields (enable in More features).
Add a list type report field, with some list values and an initial value.
Return to the workspace chat.
Go to expense report.
Click on the list report field.
Select a different list value.
Revisit the report.
Click on the list report field.
Click on the already selected value (so that it will change to the initial value).
Revisit the report.
Expected Result:
The system message will not contain "undefined".
Actual Result:
The system message contains "undefined" when the list value is changed back to the initial value.
@bfitzexpensify FYI I haven't added the External label as I wasn't 100% sure about this issue. Please take a look and add the label if you agree it's a bug and can be handled by external contributors
What changes do you think we should make in order to solve the problem?
We should add another case when the new value doesn't exist to display a message like remove the ${fieldName} (previously "${oldValue}"). We also need to create a new translation key for this message
changed the title [-]Report fields -System message shows undefined when list value is changed back to initial value[/-][+][$250] Report fields -System message shows undefined when list value is changed back to initial value[/+]on Aug 12, 2024
The solution for this issue has been 🚀 deployed to production 🚀 in version 9.0.86-3 and is now subject to a 7-day regression period 📆. Here is the list of pull requests that resolve this issue:
@dukenv0307@bfitzexpensify@dukenv0307 The PR fixing this issue has been merged! The following checklist (instructions) will need to be completed before the issue can be closed. Please copy/paste the BugZero Checklist from here into a new comment on this GH and complete it. If you have the K2 extension, you can simply click: [this button]
[Contributor] If the regression was CRITICAL (e.g. interrupts a core flow) A discussion in https://app.slack.com/client/E047TPA624F/C01GTK53T8Q 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.
Awaiting PaymentAuto-added when associated PR is deployed to productionBugSomething is broken. Auto assigns a BugZero manager.DailyKSv2DesignExternalAdded to denote the issue can be worked on by a contributor
Activity
melvin-bot commentedon Aug 8, 2024
Triggered auto assignment to @bfitzexpensify (
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.IuliiaHerets commentedon Aug 8, 2024
We think that this bug might be related to #wave-control
IuliiaHerets commentedon Aug 8, 2024
@bfitzexpensify FYI I haven't added the External label as I wasn't 100% sure about this issue. Please take a look and add the label if you agree it's a bug and can be handled by external contributors
etCoderDysto commentedon Aug 8, 2024
Edited by proposal-police: This proposal was edited at 2024-08-08 13:17:27 UTC.
Proposal
Please re-state the problem that we are trying to solve in this issue.
System message shows undefined when list value is changed back to initial value
What is the root cause of that problem?
When selecting the same value (
fieldValue === option.text), we assign empty string tofieldKeyand pass it to the submit functionApp/src/pages/EditReportFieldDropdown.tsx
Line 111 in 9c7c4a1
Then when value is an empty string we assign
nulltovalueprop, update the BE with with a newreportFieldthat has null as a valueApp/src/pages/EditReportFieldPage.tsx
Lines 76 to 82 in 9c7c4a1
Then BE returns a report action object that have null on
originalMessage.newValuepropWhat changes do you think we should make in order to solve the problem?
We should remove
from
App/src/pages/EditReportFieldDropdown.tsx
Line 111 in 9c7c4a1
Or we should change it to
What alternative solutions did you explore? (Optional)
We can dismiss the modal when value is an empty string
nkdengineer commentedon Aug 8, 2024
Edited by proposal-police: This proposal was edited at 2024-08-08 13:11:00 UTC.
Proposal
Please re-state the problem that we are trying to solve in this issue.
The system message contains "undefined" when the list value is changed back to the initial value.
What is the root cause of that problem?
If the selected value is the current value of the report field, we pass it as empty string here
App/src/pages/EditReportFieldDropdown.tsx
Line 111 in 4f45424
Then here we pass the new value of the report field as null
App/src/pages/EditReportFieldPage.tsx
Line 82 in 4f45424
So BE returns the new value in report action as
null. Then when merging data to Onyx, thenewValuefield is deleted since it hasnullvalue.It leads
newValuebeingundefinedwhen we get the message hereApp/src/libs/ReportActionsUtils.ts
Line 1223 in 4f45424
What changes do you think we should make in order to solve the problem?
We should add another case when the new value doesn't exist to display a message like
remove the ${fieldName} (previously "${oldValue}"). We also need to create a new translation key for this messageApp/src/libs/ReportActionsUtils.ts
Line 1220 in 4f45424
What alternative solutions did you explore? (Optional)
We can do nothing if the user select the selected value
App/src/pages/EditReportFieldDropdown.tsx
Lines 111 to 112 in 4f45424
nkdengineer commentedon Aug 8, 2024
Updated proposal
etCoderDysto commentedon Aug 8, 2024
Updated proposalAdded an alternative solution[-]Report fields -System message shows undefined when list value is changed back to initial value[/-][+][$250] Report fields -System message shows undefined when list value is changed back to initial value[/+]melvin-bot commentedon Aug 12, 2024
Job added to Upwork: https://www.upwork.com/jobs/~014a67065c97e4bdba
162 remaining items
melvin-bot commentedon Jan 17, 2025
The solution for this issue has been 🚀 deployed to production 🚀 in version 9.0.86-3 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 2025-01-24. 🎊
For reference, here are some details about the assignees on this issue:
melvin-bot commentedon Jan 17, 2025
@dukenv0307 @bfitzexpensify @dukenv0307 The PR fixing this issue has been merged! The following checklist (instructions) will need to be completed before the issue can be closed. Please copy/paste the BugZero Checklist from here into a new comment on this GH and complete it. If you have the K2 extension, you can simply click: [this button]
melvin-bot commentedon Jan 27, 2025
@cead22, @grgia, @bfitzexpensify, @dukenv0307, @dubielzyk-expensify, @nkdengineer, @etCoderDysto Uh oh! This issue is overdue by 2 days. Don't forget to update your issues!
bfitzexpensify commentedon Jan 27, 2025
@dukenv0307 bump on the BZ checklist
bfitzexpensify commentedon Jan 27, 2025
Payments complete to @nkdengineer @etCoderDysto
dukenv0307 commentedon Jan 29, 2025
BugZero Checklist:
Bug classification
Source of bug:
Where bug was reported:
Who reported the bug:
[Contributor] 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: https://github.com/Expensify/App/pull/36553/files#r1933927246
[Contributor] If the regression was CRITICAL (e.g. interrupts a core flow) A discussion in https://app.slack.com/client/E047TPA624F/C01GTK53T8Q 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: N/A
[Contributor] If it was decided to create a regression test for the bug, please propose the https://github.com/Expensify/App/blob/main/contributingGuides/REGRESSION_TEST_BEST_PRACTICES.md steps using the template below to ensure the same bug will not reach production again. Yes
[BugZero Assignee] Create a GH issue for creating/updating the regression test once above steps have been agreed upon.
Link to issue:
Regression Test Proposal
Test:
Set up before executing test 1, and 2
Test 1
Test 2
Do we agree 👍 or 👎
dukenv0307 commentedon Jan 29, 2025
@bfitzexpensify I completed the BZ. Thank for bumping me
bfitzexpensify commentedon Jan 29, 2025
Thanks. Proposed the regression test steps, and finalised payment.