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
[Due for payment 2026-01-05] [$250] Reports - Only one field shown when adding “A” and “a” report fields #74673
Version Number: V9.2.47-0 Reproducible in staging?: Yes Reproducible in production?: Yes If this was caught during regression testing, add the test name, ID and link from BrowserStack:#72375 Email or phone of affected tester (no customers):slottwo1alefish@gmail.com Issue reported by: Applause Internal Team Device used: Redminote 10s android 6 App Component: Workspace Settings
Action Performed:
Launch app
Go to workspace settings
Tap reports
Enable Report fields
Tap add field
Enter name as "A" in caps
Select type " Text"
Set initial value {field:a}
Tap save
Tap add field
Enter name as "a" in lowercase
Select type as "text"
Set initial value as {field:b}
Note instead of 2 fields, only second added field is shown in lists
Expected Result:
Since both field names are saved successfully, both fields (A and a) should be shown in the list.
Actual Result:
Only the second field (“a”) is shown in the report field list. The first field (“A”) disappears after adding the second field with the same name in lowercase.
Please re-state the problem that we are trying to solve in this issue.
Reports - Only one field shown when adding "A" and "a" report fields
What is the root cause of that problem?
generateFieldID converts the field name to uppercase when generating the fieldID. This causes fields with names "A" and "a" to generate the same fieldID (field_id_A). Since report fields are stored in the fieldList object using the fieldID as the key, the second field overwrites the first one
Please re-state the problem that we are trying to solve in this issue.
Only the second field (“a”) is shown in the report field list. The first field (“A”) disappears after adding the second field with the same name in lowercase.
What is the root cause of that problem?
When we create a new report filed, we are getting the ID from generateFieldID and in this function we are using toUpperCase => 'a' and A has the same id
What alternative solutions did you explore? (Optional)
Reminder: Please use plain English, be brief and avoid jargon. Feel free to use images, charts or pseudo-code if necessary. Do not post large multi-line diffs or write walls of text. Do not create PRs unless you have been hired for this job.
Please re-state the problem that we are trying to solve in this issue.
Only the second field (“a”) is shown in the report field list. The first field (“A”) disappears after adding the second field with the same name in lowercase.
What is the root cause of that problem?
The generateFieldID function converts field names to uppercase when generating field ID --> caused fields named "A" and "a" to both generate the same field ID: field_id_A. Since report fields are stored in the fieldList object using the field ID as the key, the second field would overwrite the first one.
What changes do you think we should make in order to solve the problem?
We should check for case-insensitive duplicates by comparing the generated field IDs instead of just the field names
}else{// Check for case-insensitive duplicates by comparing generated field IDsconstnewFieldID=generateFieldID(name);constexistingField=Object.values(policy?.fieldList??{}).find((reportField)=>reportField.fieldID===newFieldID);if(existingField){errors[INPUT_IDS.NAME]=translate('workspace.reportFields.existingReportFieldNameError');}}if([...name].length>CONST.WORKSPACE_REPORT_FIELD_POLICY_MAX_LENGTH){
Reminder: Please use plain English, be brief and avoid jargon. Feel free to use images, charts or pseudo-code if necessary. Do not post large multi-line diffs or write walls of text. Do not create PRs unless you have been hired for this job.
changed the title [-]Reports - Only one field shown when adding “A” and “a” report fields[/-][+][$250] Reports - Only one field shown when adding “A” and “a” report fields[/+]on Nov 10, 2025
@nyomanjyotisa's proposal looks good to me!
I don't think we need to generate a random ID or append an index, as that will make the existence of multiple identical report fields possible. So @nyomanjyotisa's proposal is simple and effective
[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: N/A, this is a change to the expected behavior
[Contributor] If the regression was CRITICAL (e.g. interrupts a core flow) A discussion in #expensify-open-source 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: regression wasn't critical
[Contributor] If it was decided to create a regression test for the bug, please propose the regression test steps using the template below to ensure the same bug will not reach production again.
Regression Test Proposal Template
[BugZero Assignee] Create a GH issue for creating/updating the regression test once above steps have been agreed upon.
I'd say this is a follow-up. We added a check and an error for it in the original PR, which surfaced this: "Error is cleared when you change the field type".
I did observe this behavior when reviewing the original PR, but considered it to be expected (the error is dismissed when you change something, the check is re-run when you press save, error appears). But the expected behavior turned out to be different, hence this follow-up
Can you confirm via a comment, tag me, then close this issue? Thx
Activity
melvin-bot commentedon Nov 10, 2025
Triggered auto assignment to @heyjennahay (
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.nyomanjyotisa commentedon Nov 10, 2025
Proposal
Please re-state the problem that we are trying to solve in this issue.
Reports - Only one field shown when adding "A" and "a" report fields
What is the root cause of that problem?
generateFieldIDconverts the field name to uppercase when generating the fieldID. This causes fields with names "A" and "a" to generate the same fieldID (field_id_A). Since report fields are stored in thefieldListobject using the fieldID as the key, the second field overwrites the first oneApp/src/libs/WorkspaceReportFieldUtils.ts
Lines 68 to 70 in fc89cfe
What changes do you think we should make in order to solve the problem?
We can remove the
.toUpperCasecall from thegenerateFieldIDto make fieldID generation case-sensitiveApp/src/libs/WorkspaceReportFieldUtils.ts
Lines 68 to 70 in fc89cfe
What alternative solutions did you explore? (Optional)
Add case-insensitive validation in the form validation to prevent users from creating fields with names that differ only by case
App/src/pages/workspace/reports/CreateReportFieldsPage.tsx
Lines 89 to 90 in fc89cfe
daledah commentedon Nov 10, 2025
Proposal
Please re-state the problem that we are trying to solve in this issue.
Only the second field (“a”) is shown in the report field list. The first field (“A”) disappears after adding the second field with the same name in lowercase.
What is the root cause of that problem?
When we create a new report filed, we are getting the ID from
generateFieldIDand in this function we are usingtoUpperCase=> 'a' andAhas the same idApp/src/libs/WorkspaceReportFieldUtils.ts
Lines 68 to 70 in fc89cfe
What changes do you think we should make in order to solve the problem?
App/src/libs/actions/Policy/ReportField.ts
Line 177 in fc89cfe
or we can remove
toUpperCaseingenerateFieldIDfunctionStr.UCFirstfrom here to removecapitalizedof the first letter when we show the report fieldApp/src/components/MoneyRequestReportView/MoneyRequestViewReportFields.tsx
Lines 58 to 60 in fc89cfe
What alternative solutions did you explore? (Optional)
Reminder: Please use plain English, be brief and avoid jargon. Feel free to use images, charts or pseudo-code if necessary. Do not post large multi-line diffs or write walls of text. Do not create PRs unless you have been hired for this job.
thelullabyy commentedon Nov 10, 2025
Proposal
Please re-state the problem that we are trying to solve in this issue.
Only the second field (“a”) is shown in the report field list. The first field (“A”) disappears after adding the second field with the same name in lowercase.
What is the root cause of that problem?
The generateFieldID function converts field names to uppercase when generating field ID --> caused fields named "A" and "a" to both generate the same field ID: field_id_A. Since report fields are stored in the fieldList object using the field ID as the key, the second field would overwrite the first one.
App/src/libs/WorkspaceReportFieldUtils.ts
Lines 68 to 70 in e48fbfa
Then the validation logic here checks for exact name matches (case-sensitive), which doesn't catch the issue
App/src/pages/workspace/reports/CreateReportFieldsPage.tsx
Lines 86 to 97 in 51a7f1e
What changes do you think we should make in order to solve the problem?
We should check for case-insensitive duplicates by comparing the generated field IDs instead of just the field names
App/src/pages/workspace/reports/CreateReportFieldsPage.tsx
Lines 88 to 90 in 51a7f1e
What alternative solutions did you explore? (Optional)
We can generate a unique field ID by appending a counter if the base ID already exists
App/src/libs/actions/Policy/ReportField.ts
Line 177 in 21cb532
Reminder: Please use plain English, be brief and avoid jargon. Feel free to use images, charts or pseudo-code if necessary. Do not post large multi-line diffs or write walls of text. Do not create PRs unless you have been hired for this job.
[-]Reports - Only one field shown when adding “A” and “a” report fields[/-][+][$250] Reports - Only one field shown when adding “A” and “a” report fields[/+]melvin-bot commentedon Nov 10, 2025
Job added to Upwork: https://www.upwork.com/jobs/~021987959690602612587
melvin-bot commentedon Nov 10, 2025
Triggered auto assignment to Contributor-plus team member for initial proposal review - @eVoloshchak (
External)eVoloshchak commentedon Nov 12, 2025
@nyomanjyotisa's proposal looks good to me!
I don't think we need to generate a random ID or append an index, as that will make the existence of multiple identical report fields possible. So @nyomanjyotisa's proposal is simple and effective
🎀👀🎀 C+ reviewed!
29 remaining items
heyjennahay commentedon Jan 7, 2026
@eVoloshchak can you please complete the BZ checklist when you have a moment so I can process everyones' payments?
eVoloshchak commentedon Jan 8, 2026
BugZero Checklist:
[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: N/A, this is a change to the expected behavior
[Contributor] If the regression was CRITICAL (e.g. interrupts a core flow) A discussion in #expensify-open-source 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: regression wasn't critical
[Contributor] If it was decided to create a regression test for the bug, please propose the regression test steps using the template below to ensure the same bug will not reach production again.
[BugZero Assignee] Create a GH issue for creating/updating the regression test once above steps have been agreed upon.
Link to issue: https://github.com/Expensify/Expensify/issues/587891
Regression Test Proposal
Precondition:
Test:
Do we agree 👍 or 👎
heyjennahay commentedon Jan 13, 2026
Payment summary
Thanks everyone!
mallenexpensify commentedon Jan 16, 2026
@marcaaron lil help plz. #78438 came from this issue. I was asking @eVoloshchak about and he said
Can you confirm via a comment, tag me, then close this issue? Thx
marcaaron commentedon Jan 17, 2026
Commented @mallenexpensify
trjExpensify commentedon Jan 31, 2026
approved $250 for @eVoloshchak.