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 2023-12-04] [$500] [Wave 6: Tags] In the Tag list, two tags are highlighted at the same time #30465
Version Number: 1.3.91-0 Reproducible in staging?: Y Reproducible in production?: Y 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 Expensify/Expensify Issue URL: Issue reported by: Applause-Internal Team Slack conversation: @
Action Performed:
Under the administrator account, log in to OldD
Enable Tag in the policy and add 7 tags
Add an employee to the policy
Log in to NewD under the employee's account
Create an IOU with Tag
Under admin in OldD, disable the selected Tag
In NewD, as an employee, log in to the created IOU and enter the Tag list in the fields.
Select another tag (you may need to repeat this step several times)
Expected Result:
Only one selected tag should be highlighted in the Tag list in all cases
Actual Result:
When you disable any Tag in OldD in the IOU(NewD) details in the Tag section, two fields are highlighted instead of the one selected.
Workaround:
Unknown
Platforms:
Which of our officially supported platforms is this issue occurring on?
changed the title [-] IOU - In the Tag list, two tags are highlighted at the same time[/-][+][$500] IOU - In the Tag list, two tags are highlighted at the same time[/+]on Oct 26, 2023
Please re-state the problem that we are trying to solve in this issue.
When you disable any Tag in OldD in the IOU(NewD) details in the Tag section, two fields are highlighted instead of the one selected.
What is the root cause of that problem?
In here, when calculating the initialFocusedIndex, we're getting the index of the selected tag in the original list, let's say the index is 4. The tag at index 3, is the tag that was selected then disabled, then we select the tag at index 4.
However, we're actually displaying the only the enabled tags, so in this case the index of the selected tag in the list that is shown is 3 (because the 3rd index tag is disabled so it's not contained in the list).
So 2 tags will be highlighted:
The selected tag at index 3
And the tag at index 4 that corresponds to the initialFocusedIndex calculated here
What changes do you think we should make in order to solve the problem?
We need to make sure when getting the initialFocusedIndex, we get it from the list that will actually be shown in the OptionsSelector, we need to filter out the disabled tags here before calculating it.
And use it here to calculate the initialFocusedIndex, and here when getting the count as well.
What alternative solutions did you explore? (Optional)
We can additionally modify the UX to still show the "disabled but selected" tag. So that tag will still appear in the list. The logic above is still needed to ensure that the list of tags shown to the user and the list used to calculate initialFocusedIndex is always the same.
The solution for this issue has been 🚀 deployed to production 🚀 in version 1.4.3-11 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 2023-12-04. 🎊
After the hold period is over and BZ checklist items are completed, please complete any of the applicable payments for this issue, and check them off once done.
External issue reporter
Contributor that fixed the issue
Contributor+ that helped on the issue and/or PR
For reference, here are some details about the assignees on 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:
[@alitoshmatov] The PR that introduced the bug has been identified. Link to the PR:
[@alitoshmatov] 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:
[@alitoshmatov] 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:
[@alitoshmatov] Determine if we should create a regression test for this bug.
[@alitoshmatov] 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.
[@kevinksullivan] Link the GH issue for creating/updating the regression test once above steps have been agreed upon:
[@alitoshmatov] The PR that introduced the bug has been identified. Link to the PR: #27765
[@alitoshmatov] 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: #27765 (comment)
[@alitoshmatov] 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: No discussion needed
[@alitoshmatov] Determine if we should create a regression test for this bug. No regression test needed
Activity
melvin-bot commentedon Oct 26, 2023
Triggered auto assignment to @kevinksullivan (
Bug), see https://stackoverflow.com/c/expensify/questions/14418 for more details.[-] IOU - In the Tag list, two tags are highlighted at the same time[/-][+][$500] IOU - In the Tag list, two tags are highlighted at the same time[/+]melvin-bot commentedon Oct 26, 2023
Job added to Upwork: https://www.upwork.com/jobs/~0193a0141499ea9bba
melvin-bot commentedon Oct 26, 2023
Bug0 Triage Checklist (Main S/O)
Platformsin OP are ✅)melvin-bot commentedon Oct 26, 2023
Triggered auto assignment to Contributor-plus team member for initial proposal review - @alitoshmatov (
External)tienifr commentedon Oct 27, 2023
Proposal
Please re-state the problem that we are trying to solve in this issue.
When you disable any Tag in OldD in the IOU(NewD) details in the Tag section, two fields are highlighted instead of the one selected.
What is the root cause of that problem?
In here, when calculating the
initialFocusedIndex, we're getting the index of the selected tag in the original list, let's say the index is 4. The tag at index 3, is the tag that was selected then disabled, then we select the tag at index 4.However, we're actually displaying the only the enabled tags, so in this case the index of the selected tag in the list that is shown is 3 (because the 3rd index tag is disabled so it's not contained in the list).
So 2 tags will be highlighted:
initialFocusedIndexcalculated hereWhat changes do you think we should make in order to solve the problem?
We need to make sure when getting the
initialFocusedIndex, we get it from the list that will actually be shown in theOptionsSelector, we need to filter out the disabled tags here before calculating it.We can assign the enabled tags to a variable
And use it here to calculate the
initialFocusedIndex, and here when getting the count as well.What alternative solutions did you explore? (Optional)
We can additionally modify the UX to still show the "disabled but selected" tag. So that tag will still appear in the list. The logic above is still needed to ensure that the list of tags shown to the user and the list used to calculate
initialFocusedIndexis always the same.melvin-bot commentedon Oct 30, 2023
@kevinksullivan, @alitoshmatov Uh oh! This issue is overdue by 2 days. Don't forget to update your issues!
alitoshmatov commentedon Oct 30, 2023
Reviewing
52 remaining items
melvin-bot commentedon Nov 27, 2023
The solution for this issue has been 🚀 deployed to production 🚀 in version 1.4.3-11 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 2023-12-04. 🎊
After the hold period is over and BZ checklist items are completed, please complete any of the applicable payments for this issue, and check them off once done.
For reference, here are some details about the assignees on this issue:
melvin-bot commentedon Nov 27, 2023
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:
alitoshmatov commentedon Dec 6, 2023
[@alitoshmatov] The PR that introduced the bug has been identified. Link to the PR: #27765
[@alitoshmatov] 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: #27765 (comment)
[@alitoshmatov] 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: No discussion needed
[@alitoshmatov] Determine if we should create a regression test for this bug. No regression test needed
alitoshmatov commentedon Dec 6, 2023
Looks like we are ready to process the payment
melvin-bot commentedon Dec 11, 2023
@tylerkaraszewski, @kevinksullivan, @alitoshmatov, @tienifr Huh... This is 4 days overdue. Who can take care of this?
kevinksullivan commentedon Dec 12, 2023
All set with payments!