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
[$250] Expense - Review duplicates is shown for approver after employee resolved duplicates #73414
changed the title [-]Expense - Review duplicates is shown for approver after employee resolved duplicates[/-][+][$250] Expense - Review duplicates is shown for approver after employee resolved duplicates[/+]on Oct 24, 2025
🚨 Edited by proposal-police: This proposal was edited at 2025-11-05 16:27:28 UTC.
Proposal
Please re-state the problem that we are trying to solve in this issue.
Review duplicates is shown for approver after employee resolved duplicates by tapping keep all.
What is the root cause of that problem?
isViolationDismissed is checking the the violation is dismissed by current user. Since the violation is dismissed by employee, it's still displayed for approver
What specific scenarios should we cover in automated tests to prevent reintroducing this issue in the future?
Test isViolationDismissed function to verify that it returns true if the violation is dismissed by another user who is not current user
What alternative solutions did you explore? (Optional)
We can only do this check !!Object.values(transaction?.comment?.dismissedViolations?.[violation.name] ?? {}).length if the violation is duplicate or define a new param to check whether we should check the violation is dismissed by anyone.
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.
Expense - Review duplicates is shown for approver after employee resolved duplicates
What is the root cause of that problem?
When an employee dismissed duplicate violations by tapping "Keep all", the approver would still see the "Review duplicates" button. This happened because: The code was storing the dismissal in TWO places:
In TRANSACTION_VIOLATIONS collection (violations list) - correctly filtered out the duplicate violation
Approver checked: isViolationDismissed(..., approver@email) → looked for dismissedViolations.duplicatedTransaction[approver@email] → NOT FOUND → returned false
Therefore: Approver still saw the "Review duplicates" button
What changes do you think we should make in order to solve the problem?
We should remove the redundant dismissal storage in dismissedViolations for duplicate violations. The violation is already being removed from the violations list, which is the source of truth
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.
isViolationDismissed was added in #54455 PR as a part of #53398 issue to make the behavior in newDot consistent with oldDot. I think it’d be helpful to review both the issue and PR for more context.
@paulnjs Instead of removing currentUserEmail entirely, could we simply avoid passing it for this specific case?
Activity
melvin-bot commentedon Oct 24, 2025
Triggered auto assignment to @clarajones-expensify (
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.[-]Expense - Review duplicates is shown for approver after employee resolved duplicates[/-][+][$250] Expense - Review duplicates is shown for approver after employee resolved duplicates[/+]melvin-bot commentedon Oct 24, 2025
Job added to Upwork: https://www.upwork.com/jobs/~021981772328646379882
melvin-bot commentedon Oct 24, 2025
Triggered auto assignment to Contributor-plus team member for initial proposal review - @sobitneupane (
External)paulnjs commentedon Oct 24, 2025
🚨 Edited by proposal-police: This proposal was edited at 2025-11-05 16:27:28 UTC.
Proposal
Please re-state the problem that we are trying to solve in this issue.
Review duplicates is shown for approver after employee resolved duplicates by tapping keep all.
What is the root cause of that problem?
isViolationDismissedis checking the the violation is dismissed by current user. Since the violation is dismissed by employee, it's still displayed for approverApp/src/libs/TransactionUtils/index.ts
Lines 1323 to 1328 in c85cfc4
What changes do you think we should make in order to solve the problem?
We can remove
currentUserEmailand check whethertransaction?.comment?.dismissedViolations?.[violation.name]has some values insteadApp/src/libs/TransactionUtils/index.ts
Lines 1323 to 1328 in c85cfc4
What specific scenarios should we cover in automated tests to prevent reintroducing this issue in the future?
Test
isViolationDismissedfunction to verify that it returnstrueif the violation is dismissed by another user who is not current userWhat alternative solutions did you explore? (Optional)
We can only do this check
!!Object.values(transaction?.comment?.dismissedViolations?.[violation.name] ?? {}).lengthif the violation is duplicate or define a new param to check whether we should check the violation is dismissed by anyone.App/src/libs/TransactionUtils/index.ts
Lines 1323 to 1328 in c85cfc4
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.
lorretheboy commentedon Oct 25, 2025
Proposal
Please re-state the problem that we are trying to solve in this issue.
Expense - Review duplicates is shown for approver after employee resolved duplicates
What is the root cause of that problem?
When an employee dismissed duplicate violations by tapping "Keep all", the approver would still see the "Review duplicates" button. This happened because: The code was storing the dismissal in TWO places:
In
TRANSACTION_VIOLATIONScollection (violations list) - correctly filtered out the duplicate violationApp/src/libs/actions/Transaction.ts
Line 94 in 7ae48f3
In
transaction.comment.dismissedViolations- stored per-user emailApp/src/libs/actions/Transaction.ts
Lines 460 to 464 in 7ae48f3
But the
isViolationDismissedfunction only checked if the violation was dismissed for the current userApp/src/libs/TransactionUtils/index.ts
Lines 1309 to 1314 in 092472e
Which then caused the mismatch:
dismissedViolations.duplicatedTransaction[employee@email] = timestampisViolationDismissed(..., approver@email)→ looked fordismissedViolations.duplicatedTransaction[approver@email]→ NOT FOUND → returned falseTherefore: Approver still saw the "Review duplicates" button
What changes do you think we should make in order to solve the problem?
We should remove the redundant dismissal storage in dismissedViolations for duplicate violations. The violation is already being removed from the violations list, which is the source of truth
App/src/libs/actions/Transaction.ts
Lines 453 to 469 in 7ae48f3
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.
melvin-bot commentedon Oct 27, 2025
@sobitneupane Uh oh! This issue is overdue by 2 days. Don't forget to update your issues!
sobitneupane commentedon Oct 29, 2025
Thanks for the proposal, @paulnjs and @lorretheboy
isViolationDismissedwas added in #54455 PR as a part of #53398 issue to make the behavior in newDot consistent with oldDot. I think it’d be helpful to review both the issue and PR for more context.@paulnjs Instead of removing
currentUserEmailentirely, could we simply avoid passing it for this specific case?27 remaining items
clarajones-expensify commentedon Dec 4, 2025
@pecanoro - is this comment correct? if so i will close this out. TY!
melvin-bot commentedon Dec 5, 2025
📣 It's been a week! Do we have any satisfactory proposals yet? Do we need to adjust the bounty for this issue? 💸
melvin-bot commentedon Dec 9, 2025
This issue has not been updated in over 14 days. @sobitneupane, @clarajones-expensify eroding to Weekly issue.
melvin-bot commentedon Dec 12, 2025
📣 It's been a week! Do we have any satisfactory proposals yet? Do we need to adjust the bounty for this issue? 💸
mvtglobally commentedon Dec 13, 2025
Issue not reproducible during KI retests. (First week)
melvin-bot commentedon Dec 19, 2025
📣 It's been a week! Do we have any satisfactory proposals yet? Do we need to adjust the bounty for this issue? 💸
sobitneupane commentedon Dec 22, 2025
Issue not reproducible.
pecanoro commentedon Dec 23, 2025
Let's close this since it's not reproducible