Skip to content

[HOLD for payment 2024-10-25] [$250] [Dupe detect] Not here page opens when opening distance receipt from another workspace #50107

Closed

Description

@IuliiaHerets

If you haven’t already, check out our contributing guidelines for onboarding and email contributors@expensify.com to request to join our Slack channel!


Version Number: 9.0.43-3
Reproducible in staging?: Y
Reproducible in production?: Y
Email or phone of affected tester (no customers): applausetester+pso@applause.expensifail.com
Issue reported by: Applause Internal Team

Action Performed:

  1. Go to staging.new.expensify.com
  2. Create two workspaces.
  3. Submit a distance expense in the first workspace chat.
  4. Submit the same distance expense in the second workspace chat.
  5. Submit another expense to the second workspace chat (as we cannot review duplicates when there is only one expense).
  6. Go to transaction thread of the second expense in Step 4.
  7. Click Review duplicates.
  8. Click on the second distance expense preview (to make Keep this one button appear).
  9. Click browser back button.
  10. Click Keep this one on the second expense preview.
  11. Click on the receipt on the confirmation page.

Expected Result:

The receipt opens without issue.

Actual Result:

Not here page opens when opening distance receipt from another workspace in full screen.

Workaround:

Unknown

Platforms:

  • Android: Native
  • Android: mWeb Chrome
  • iOS: Native
  • iOS: mWeb Safari
  • MacOS: Chrome / Safari
  • MacOS: Desktop

Screenshots/Videos

Bug6622310_1727885989783.20241003_001259.mp4

View all open jobs on GitHub

Upwork Automation - Do Not Edit
  • Upwork Job URL: https://www.upwork.com/jobs/~021842274975898423185
  • Upwork Job ID: 1842274975898423185
  • Last Price Increase: 2024-10-04
  • Automatic offers:
    • rojiphil | Reviewer | 104346977
    • nkdengineer | Contributor | 104346978
Issue OwnerCurrent Issue Owner: @joekaufmanexpensify

Activity

  1. added
    BugSomething is broken. Auto assigns a BugZero manager.
    on Oct 2, 2024
  2. melvin-bot commented on Oct 2, 2024

    @melvin-bot

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

  3. IuliiaHerets commented on Oct 2, 2024

    @IuliiaHerets
    Author

    We think that this bug might be related to #wave-control

  4. IuliiaHerets commented on Oct 2, 2024

    @IuliiaHerets
    Author

    @joekaufmanexpensify 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

  5. nkdengineer commented on Oct 2, 2024

    @nkdengineer
    Contributor

    Proposal

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

    Not here page opens when opening distance receipt from another workspace in full screen.

    What is the root cause of that problem?

    Here we are calculating shouldShowNotFoundPage based on moneyRequestReportID and transaction?.reportID and will show NotFoundPage when they are different

    const shouldShowNotFoundPage = isTrackExpenseReport || transaction?.reportID === CONST.REPORT.SPLIT_REPORTID ? !transaction : (moneyRequestReportID ?? '-1') !== transaction?.reportID;

    But in case review duplicates with expsense in another workspace, it is no longer true because this transaction does not belong to the same report so moneyRequestReportID will calculate wrong

    const moneyRequestReportID = ReportUtils.isMoneyRequestReport(report) ? report?.reportID : report?.parentReportID;

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

    1. We should add new route param like isFromReviewDuplicates for route TRANSACTION_RECEIPT here
        TRANSACTION_RECEIPT: {
            route: 'r/:reportID/transaction/:transactionID/receipt',
            getRoute: (reportID: string, transactionID: string, readonly = false, isFromReviewDuplicates = false) => `r/${reportID}/transaction/${transactionID}/receipt${readonly ? '?readonly=true' : ''}${isFromReviewDuplicates ? '?isFromReviewDuplicates=true' : ''}` as const,
        },
    
    1. Use this param when calculating shouldShowNotFoundPage here
        const shouldShowNotFoundPage = isTrackExpenseReport || transaction?.reportID === CONST.REPORT.SPLIT_REPORTID || isFromReviewDuplicates ? !transaction : (moneyRequestReportID ?? '-1') !== transaction?.reportID;
    
    1. We can pass isFromReviewDuplicates from Transaction Duplicate confirmation page here

    <MoneyRequestView
    report={report}
    shouldShowAnimatedBackground={false}
    readonly
    updatedTransaction={transaction as OnyxEntry<Transaction>}
    />

    What alternative solutions did you explore? (Optional)

  6. joekaufmanexpensify commented on Oct 4, 2024

    @joekaufmanexpensify
    Contributor

    I can reproduce this, but not sure if dupe detection across multiple workspaces is supposed to be a thing.

  7. joekaufmanexpensify commented on Oct 4, 2024

    @joekaufmanexpensify
    Contributor
  8. joekaufmanexpensify commented on Oct 4, 2024

    @joekaufmanexpensify
    Contributor

    Confirmed this is possible, but only for the submitter. Given the submitter can view the expense when resolving dupes, feels correct they should be able to view the receipt.

  9. changed the title [-]Dupe detect - Not here page opens when opening distance receipt from another workspace[/-] [+][$250] Dupe detect - Not here page opens when opening distance receipt from another workspace[/+] on Oct 4, 2024
  10. melvin-bot commented on Oct 4, 2024

    @melvin-bot
  11. added
    Help WantedApply this label when an issue is open to proposals by contributors
    on Oct 4, 2024
  12. 29 remaining items

  13. joekaufmanexpensify commented on Oct 21, 2024

    @joekaufmanexpensify
    Contributor

    @nkdengineer @rojiphil was the regression notice above legit?

  14. rojiphil commented on Oct 21, 2024

    @rojiphil
    Contributor

    was the regression notice above legit?

    Yes @joekaufmanexpensify. That is correct.

  15. joekaufmanexpensify commented on Oct 22, 2024

    @joekaufmanexpensify
    Contributor

    Got it. TY for confirming!

  16. joekaufmanexpensify commented on Oct 22, 2024

    @joekaufmanexpensify
    Contributor

    @rojiphil can you also handle the BZ checklist so we can process payment in a few days?

  17. rojiphil commented on Oct 24, 2024

    @rojiphil
    Contributor
    • [@rojiphil] The PR that introduced the bug has been identified. Link to the PR: Offending PR
    • [@rojiphil] 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: Added comment
    • [@rojiphil] 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: Not Required. Existing checklist is good enough to capture such issues.
    • [@rojiphil] Determine if we should create a regression test for this bug. : Yes. We can
    • [@rojiphil] 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.

    Steps:

    1. Create two workspaces.
    2. Submit a distance expense in the first workspace chat.
    3. Submit the same distance expense in the second workspace chat.
    4. Submit another expense to the second workspace chat (as we cannot review duplicates when there is only one expense).
    5. Go to transaction thread of the second expense in Step 4.
    6. Click Review duplicates.
    7. Click on the second distance expense preview (to make Keep this one button appear).
    8. Click on the receipt on the confirmation page.
    9. Verify that: The receipt opens without issue.
  18. rojiphil commented on Oct 24, 2024

    @rojiphil
    Contributor

    can you also handle the BZ checklist so we can process payment in a few days?

    @joekaufmanexpensify BZ Checklist is done.

  19. joekaufmanexpensify commented on Oct 25, 2024

    @joekaufmanexpensify
    Contributor

    Regression test issue is here.

  20. joekaufmanexpensify commented on Oct 25, 2024

    @joekaufmanexpensify
    Contributor

    Checklist is complete. All set to issue payment!

  21. joekaufmanexpensify commented on Oct 25, 2024

    @joekaufmanexpensify
    Contributor

    We need to pay:

    • @nkdengineer $125 for PR via Upwork (50% penalty for regression)
    • @rojiphil $125 for C+ via Upwork (50% penalty for regression)
  22. joekaufmanexpensify commented on Oct 25, 2024

    @joekaufmanexpensify
    Contributor

    @nkdengineer $125 sent and contract ended!

  23. joekaufmanexpensify commented on Oct 25, 2024

    @joekaufmanexpensify
    Contributor

    @rojiphil $125 sent and contract ended!

  24. joekaufmanexpensify commented on Oct 25, 2024

    @joekaufmanexpensify
    Contributor

    Upwork job closed.

  25. joekaufmanexpensify commented on Oct 25, 2024

    @joekaufmanexpensify
    Contributor

    All set, thanks everyone!

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Metadata

Metadata

Labels

Awaiting PaymentAuto-added when associated PR is deployed to productionBugSomething is broken. Auto assigns a BugZero manager.ExternalAdded to denote the issue can be worked on by a contributorWeeklyKSv2

Type

No type

Projects

Milestone

No milestone

Relationships

None yet

Development

No branches or pull requests

Issue actions