Skip to content

[$500] Add BA thread is missing Add button, incomplete thread header and "Hidden" user #38126

Closed

Description

@kavimuru

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: 1.4.50-2
Reproducible in staging?: y
Reproducible in production?: y
If this was caught during regression testing, add the test name, ID and link from TestRail: exploratory around https://expensify.testrail.io/index.php?/tests/view/4414706
Logs: https://stackoverflow.com/c/expensify/questions/4856
Expensify/Expensify Issue URL:
Issue reported by: applause internal team
Slack conversation:

Action Performed:

Precondition:

  • Admin and employee are in the Collect workspace.
  • Admin has bank account account.
  • Employee does not have a bank account.
  1. [Employee] Go to staging.new.expensify.com.
  2. [Employee] Go to workspace chat and create a manual request.
  3. [Admin] Pay the request with Expensify.
  4. [Employee] Go to expense report.
  5. [Employee] Right click on "started settling up," message > Reply in thread.

Expected Result:

  • Add bank account button will appear in thread.
  • Thread header will show the complete parent message.
  • No "Hidden" will display in parent message in thread.

Actual Result:

  • Add bank account button does not appear in thread.
  • Thread header shows admin email address instead of complete parent message.
  • "Hidden" is displayed in parent message in thread - "started settling up, payment is held until Hidden adds a bank account"

Workaround:

unknown

Platforms:

Which of our officially supported platforms is this issue occurring on?

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

Screenshots/Videos

Add any screenshot/video evidence

Bug6410857_1710235799988.20240312_172059.mp4
Bug6410857_1710235799984!Screenshot_2024-03-12_at_17 22 52

View all open jobs on GitHub

Upwork Automation - Do Not Edit
  • Upwork Job URL: https://www.upwork.com/jobs/~0168f850ea211df0b2
  • Upwork Job ID: 1767551381908271104
  • Last Price Increase: 2024-03-12
  • Automatic offers:
    • akinwale | Reviewer | 0
    • FitseTLT | Contributor | 0

Activity

  1. added
    Daily
    Bug
    on Mar 12, 2024
  2. melvin-bot commented on Mar 12, 2024

    @melvin-bot

    Triggered auto assignment to @sonialiap (Bug), see https://stackoverflow.com/c/expensify/questions/14418 for more details.

  3. kavimuru commented on Mar 12, 2024

    @kavimuru
    Author

    @sonialiap 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.

  4. kavimuru commented on Mar 12, 2024

    @kavimuru
    Author

    We think this bug might be related to #vip-vsb
    cc @quinthar

  5. sonialiap commented on Mar 12, 2024

    @sonialiap
    Contributor

    The submitter is an employee of a workspace, I believe the admin should be able to see the email address in this case. We should fix

  6. added
    External
    on Mar 12, 2024
  7. changed the title [-]Add BA thread is missing Add button, incomplete thread header and "Hidden" user[/-] [+][$500] Add BA thread is missing Add button, incomplete thread header and "Hidden" user[/+] on Mar 12, 2024
  8. melvin-bot commented on Mar 12, 2024

    @melvin-bot
  9. added
    Help Wanted
    on Mar 12, 2024
  10. melvin-bot commented on Mar 12, 2024

    @melvin-bot

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

  11. FitseTLT commented on Mar 12, 2024

    @FitseTLT
    Contributor

    Proposal

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

    Add BA thread is missing Add button, incomplete thread header and "Hidden" user

    What is the root cause of that problem?

    1. We don't have a special condition dealing with REIMBURSEMENTQUEUED type here

      App/src/libs/ReportUtils.ts

      Lines 2617 to 2621 in 6e42e55

      const parentReportActionMessage = (
      ReportActionsUtils.isApprovedOrSubmittedReportAction(parentReportAction)
      ? ReportActionsUtils.getReportActionMessageText(parentReportAction)
      : parentReportAction?.message?.[0]?.text ?? ''
      ).replace(/(\r\n|\n|\r)/gm, ' ');
    2. Hidden is displayed - It is because the report we use here is the new thread report, not the one that the REIMBURSEMENTQUEUED originally belongs and report.ownerAccountID is 0 so hidden is displayed
      const submitterDisplayName = PersonalDetailsUtils.getDisplayNameOrDefault(personalDetails[report.ownerAccountID ?? -1]);
      const paymentType = action.originalMessage.paymentType ?? '';

      3.No Add button - We don't have a logic to display add button for these types of report actions

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

    1. For REIMBURSEMENTQUEUED type we should use ReportUtils.getReimbursementDeQueuedActionMessage here

      App/src/libs/ReportUtils.ts

      Lines 2617 to 2621 in 6e42e55

      const parentReportActionMessage = (
      ReportActionsUtils.isApprovedOrSubmittedReportAction(parentReportAction)
      ? ReportActionsUtils.getReportActionMessageText(parentReportAction)
      : parentReportAction?.message?.[0]?.text ?? ''
      ).replace(/(\r\n|\n|\r)/gm, ' ');
    const parentReportActionMessage = (
                ReportActionsUtils.isApprovedOrSubmittedReportAction(parentReportAction)
                    ? ReportActionsUtils.getReportActionMessageText(parentReportAction)
                    : ReportActionsUtils.isReimbursementQueuedAction(parentReportAction)
                    ? getReimbursementQueuedActionMessage(parentReportAction, getReport(report?.parentReportID), false)
                    : parentReportAction?.message?.[0]?.text ?? ''
            ).replace(/(\r\n|\n|\r)/gm, ' ');
    
    1. Change it to
    const submitterDisplayName = PersonalDetailsUtils.getDisplayNameOrDefault(
                   personalDetails[(report.ownerAccountID || ReportUtils.getReport(report.parentReportID)?.ownerAccountID) ?? -1],
               );
    

    or more properly when report is chat thread then we can optionally use parent report rather than the report
    3. To display Add Button we can display it in the HeaderView when it is chatThread and parentReportAction is reimbursement queue action type and this condition is fulfilled

    const shouldShowAddCreditBankAccountButton = isSubmitterOfUnsettledReport && !store.hasCreditBankAccount() && paymentType !== CONST.IOU.PAYMENT_TYPE.EXPENSIFY;
    const shouldShowEnableWalletButton =

    What alternative solutions did you explore? (Optional)

  12. FitseTLT commented on Mar 12, 2024

    @FitseTLT
    Contributor
  13. 15 remaining items

  14. FitseTLT commented on Mar 21, 2024

    @FitseTLT
    Contributor

    Sorry @sonialiap PR will be ready for review By EOW

  15. sonialiap commented on Mar 22, 2024

    @sonialiap
    Contributor

    Thanks!

  16. added
    Reviewing
    Weekly
    and removed
    Daily
    on Mar 23, 2024
  17. added and removed
    Weekly
    on Apr 16, 2024
  18. melvin-bot commented on Apr 16, 2024

    @melvin-bot

    This issue has not been updated in over 15 days. @akinwale, @chiragsalian, @sonialiap, @FitseTLT eroding to Monthly issue.

    P.S. Is everyone reading this sure this is really a near-term priority? Be brave: if you disagree, go ahead and close it out. If someone disagrees, they'll reopen it, and if they don't: one less thing to do!

  19. added
    Weekly
    and removed on Apr 21, 2024
  20. sonialiap commented on Apr 23, 2024

    @sonialiap
    Contributor

    Looks like Melvin's automation may be failing here. The PR was deployed to production yesterday. Payment will be due on Apr 29

  21. sonialiap commented on Apr 29, 2024

    @sonialiap
    Contributor

    Payment summary:

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

Metadata

Metadata

Labels

BugExternalReviewingWeekly

Type

No type

Projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions