Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

[$250] All - Approvers - Resolve Duplicates - No system message after merging duplicate expenses #54516

Open
5 of 8 tasks
IuliiaHerets opened this issue Dec 24, 2024 · 45 comments
Assignees
Labels
Bug Something is broken. Auto assigns a BugZero manager. Daily KSv2 Hot Pick Ready for an engineer to pick up and run with Internal Requires API changes or must be handled by Expensify staff

Comments

@IuliiaHerets
Copy link

IuliiaHerets commented Dec 24, 2024

If you haven’t already, check out our contributing guidelines for onboarding and email [email protected] to request to join our Slack channel!


Version Number: 9.0.78-0
Reproducible in staging?: Yes
Reproducible in production?: Yes
If this was caught on HybridApp, is this reproducible on New Expensify Standalone?: Yes, reproducible on both
If this was caught during regression testing, add the test name, ID and link from TestRail: https://expensify.testrail.io/index.php?/tests/view/5369780
Email or phone of affected tester (no customers): [email protected]
Issue reported by: Applause Internal Team
Device used: MacOS 14.7.1 / Safari, Chrome, Desktop. iPhone 15 pro / 18.2, Pixel 5 / Android 14
App Component: Chat Report View

Action Performed:

Precondition:

  1. Create admin account with Gmail
  2. Create Collect workspace, set Workflows to enabled
  3. Invite Employee and Approver with Gmail accounts to this workspace
  4. Enable Approvals in Workflows and set Approver account as Approver
  5. Enable Workflows > Delay submissions and set it to Manually

Steps:

  1. Login as the Employee and create two duplicate expenses in workspace chat
  2. Click/Tap on any expense
  3. Click/Tap "Review Duplicates" button
  4. Click/Tap "Keep this one" on any expense
  5. Select "Meal & Entertainment" to keep
  6. Select "SF Trip" to keep
  7. Tap "Confirm"

Expected Result:

Verify a system message is added that reads: “resolved the duplicate”

Actual Result:

No system message “resolved the duplicate” added after merging duplicate expenses

Workaround:

Unknown

Platforms:

  • Android: Standalone
  • Android: HybridApp
  • Android: mWeb Chrome
  • iOS: Standalone
  • iOS: HybridApp
  • iOS: mWeb Safari
  • MacOS: Chrome / Safari
  • MacOS: Desktop

Screenshots/Videos

Bug6701675_1735025357613.iOS-resolve-dupes-merge-no-system-message-after-merge.mp4

View all open jobs on GitHub

Upwork Automation - Do Not Edit
  • Upwork Job URL: https://www.upwork.com/jobs/~021873696879344029076
  • Upwork Job ID: 1873696879344029076
  • Last Price Increase: 2025-01-06
  • Automatic offers:
    • linhvovan29546 | Contributor | 105678910
Issue OwnerCurrent Issue Owner: @youssef-lr
@IuliiaHerets IuliiaHerets added Daily KSv2 Bug Something is broken. Auto assigns a BugZero manager. labels Dec 24, 2024
Copy link

melvin-bot bot commented Dec 24, 2024

Triggered auto assignment to @laurenreidexpensify (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.

@linhvovan29546
Copy link
Contributor

linhvovan29546 commented Dec 26, 2024

Edited by proposal-police: This proposal was edited at 2025-01-05 01:25:59 UTC.

Proposal

Please re-state the problem that we are trying to solve in this issue.

All - Approvers - Resolve Duplicates - No system message after merging duplicate expenses

What is the root cause of that problem?

In this issue, we use the mergeDuplicates function to merge resolve duplicates. However, we have not implemented a system message to merge duplicate expenses.

function mergeDuplicates(params: TransactionMergeParams) {

What changes do you think we should make in order to solve the problem?

We can use the ReportUtils.buildOptimisticDismissedViolationReportAction function to build optimisticReportAction as we handled in the resolveDuplicates function.

App/src/libs/actions/IOU.ts

Lines 8799 to 8803 in 918488a

const transactionThreadReportID = params.reportID ? getIOUActionForTransactions([params.transactionID], params.reportID).at(0)?.childReportID : undefined;
const optimisticReportAction = ReportUtils.buildOptimisticDismissedViolationReportAction({
reason: 'manual',
violationName: CONST.VIOLATIONS.DUPLICATED_TRANSACTION,
});

Example:

    const transactionThreadReportID = params.reportID ? getIOUActionForTransactions([params.transactionID], params.reportID).at(0)?.childReportID : undefined;
    const optimisticReportAction = ReportUtils.buildOptimisticDismissedViolationReportAction({
        reason: 'manual',
        violationName: CONST.VIOLATIONS.DUPLICATED_TRANSACTION,
    });

    const optimisticReportActionData: OnyxUpdate = {
        onyxMethod: Onyx.METHOD.MERGE,
        key: `${ONYXKEYS.COLLECTION.REPORT_ACTIONS}${transactionThreadReportID}`,
        value: {
            [optimisticReportAction.reportActionID]: optimisticReportAction,
        },
    };

.....

    parameters = {
            ...params,
            dismissedViolationReportActionID: optimisticReportAction.reportActionID,
    }

Additionally, we need backend support is for a new parameter dismissedViolationReportActionID and report_actions for system message, similar to how it is handled in the resolveDuplicates function.

POC https://github.com/user-attachments/assets/66d74dc2-6153-4e66-b969-6f4a6dbb03a4

What specific scenarios should we cover in automated tests to prevent reintroducing this issue in the future?

We can write IOUTest for IOU.mergeDuplicates

What alternative solutions did you explore? (Optional)

N/A

@melvin-bot melvin-bot bot added the Overdue label Dec 26, 2024
Copy link

melvin-bot bot commented Dec 30, 2024

@laurenreidexpensify Eep! 4 days overdue now. Issues have feelings too...

@laurenreidexpensify laurenreidexpensify added the External Added to denote the issue can be worked on by a contributor label Dec 30, 2024
@melvin-bot melvin-bot bot changed the title All - Approvers - Resolve Duplicates - No system message after merging duplicate expenses [$250] All - Approvers - Resolve Duplicates - No system message after merging duplicate expenses Dec 30, 2024
Copy link

melvin-bot bot commented Dec 30, 2024

Job added to Upwork: https://www.upwork.com/jobs/~021873696879344029076

@melvin-bot melvin-bot bot added the Help Wanted Apply this label when an issue is open to proposals by contributors label Dec 30, 2024
Copy link

melvin-bot bot commented Dec 30, 2024

Triggered auto assignment to Contributor-plus team member for initial proposal review - @getusha (External)

@laurenreidexpensify
Copy link
Contributor

@getusha have you had a chance to review proposal? thanks!

@melvin-bot melvin-bot bot added the Overdue label Jan 2, 2025
Copy link

melvin-bot bot commented Jan 3, 2025

@laurenreidexpensify, @getusha Whoops! This issue is 2 days overdue. Let's get this updated quick!

@getusha
Copy link
Contributor

getusha commented Jan 3, 2025

Reviewing

@melvin-bot melvin-bot bot removed the Overdue label Jan 3, 2025
@linhvovan29546
Copy link
Contributor

linhvovan29546 commented Jan 5, 2025

Proposal updated: Requires backend support

Copy link

melvin-bot bot commented Jan 6, 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 melvin-bot bot added the Overdue label Jan 6, 2025
@getusha
Copy link
Contributor

getusha commented Jan 6, 2025

Looks like this is a new future. @linhvovan29546's proposal looks good to me.
We need 👀 from an internal engineer on the implementation from the BE side.

🎀 👀 🎀 C+ Reviewed.

Copy link

melvin-bot bot commented Jan 6, 2025

Triggered auto assignment to @youssef-lr, see https://stackoverflow.com/c/expensify/questions/7972 for more details.

Copy link

melvin-bot bot commented Jan 7, 2025

@youssef-lr @laurenreidexpensify @getusha this issue was created 2 weeks ago. Are we close to approving a proposal? If not, what's blocking us from getting this issue assigned? Don't hesitate to create a thread in #expensify-open-source to align faster in real time. Thanks!

@laurenreidexpensify
Copy link
Contributor

@youssef-lr bump thanks

@laurenreidexpensify
Copy link
Contributor

@youssef-lr bump thanks!

@youssef-lr
Copy link
Contributor

@linhvovan29546 ah I see. In this case yeah we need a backend PR fixing this. @laurenreidexpensify I'm unable to work on this at the moment so I think we need to find a volunteer. I'm finishing my workload to go OOO.

@melvin-bot melvin-bot bot removed the Overdue label Jan 27, 2025
@laurenreidexpensify
Copy link
Contributor

@garrettmknight @dylanexpensify just a heads up we need a volunteer for this one - would we consider this a hot pick?

@dylanexpensify
Copy link
Contributor

Yeah, sounds like it @laurenreidexpensify!

@dylanexpensify dylanexpensify added the Hot Pick Ready for an engineer to pick up and run with label Jan 28, 2025
@dylanexpensify
Copy link
Contributor

@deetergp I wonder if this will be touched by the project you're working on now?

@deetergp
Copy link
Contributor

@dylanexpensify It might… Are we expecting this system message because it is a message that we get in OldDot that we are not getting in NewDot?

@linhvovan29546
Copy link
Contributor

linhvovan29546 commented Jan 29, 2025

Hi @deetergp this #54516 (comment) might help clarify things for you

@melvin-bot melvin-bot bot added the Overdue label Feb 3, 2025
@laurenreidexpensify
Copy link
Contributor

@deetergp any ideas ^^?

@melvin-bot melvin-bot bot removed the Overdue label Feb 3, 2025
@deetergp
Copy link
Contributor

deetergp commented Feb 4, 2025

@laurenreidexpensify @dylanexpensify This is not one that will be covered by my project — I believe it would be a brand new system message.

@dylanexpensify dylanexpensify moved this from Bugs and Follow Up Issues to Hotter picks in [#whatsnext] #expense Feb 4, 2025
@melvin-bot melvin-bot bot added the Overdue label Feb 6, 2025
@laurenreidexpensify laurenreidexpensify added Internal Requires API changes or must be handled by Expensify staff and removed External Added to denote the issue can be worked on by a contributor labels Feb 6, 2025
@laurenreidexpensify
Copy link
Contributor

We need an internal PR to fix this, so removing external. Dylan has been posting in #expense for visibility

@melvin-bot melvin-bot bot removed the Overdue label Feb 6, 2025
Copy link

melvin-bot bot commented Feb 10, 2025

@laurenreidexpensify, @getusha, @linhvovan29546 Uh oh! This issue is overdue by 2 days. Don't forget to update your issues!

@melvin-bot melvin-bot bot added the Overdue label Feb 10, 2025
Copy link

melvin-bot bot commented Feb 12, 2025

@laurenreidexpensify, @getusha, @linhvovan29546 Eep! 4 days overdue now. Issues have feelings too...

@laurenreidexpensify
Copy link
Contributor

Still waiting for an internal engineer to pick up

@laurenreidexpensify
Copy link
Contributor

Still waiting on internal pick up

@dylanexpensify
Copy link
Contributor

bumping this in today's weekly update

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
Bug Something is broken. Auto assigns a BugZero manager. Daily KSv2 Hot Pick Ready for an engineer to pick up and run with Internal Requires API changes or must be handled by Expensify staff
Projects
Status: Hotter picks
Development

No branches or pull requests

8 participants