Expensify / App

Welcome to New Expensify: a complete re-imagination of financial collaboration, centered around chat. Help us build the next generation of Expensify by sharing feedback and contributing to the code.
https://new.expensify.com
MIT License
3.34k stars 2.77k forks source link

Expense - Leave option doesn't appear on invitee to a IOU thread #49529

Open IuliiaHerets opened 2 hours ago

IuliiaHerets commented 2 hours ago

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.38-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: https://expensify.testrail.io/index.php?/tests/view/4986423 Email or phone of affected tester (no customers): gatantm+166@gmail.com Issue reported by: Applause Internal Team

Action Performed:

  1. In a 1:1 conversation between 2 users - Send 2 IOUs
  2. In the report conversation mention a external user (invitee)
  3. In the actionable whisper, select to invite the user
  4. Copy the report URL and send it to the Invitee
  5. Login as the invitee
  6. Navigate to the report URL and open the header

Expected Result:

The options to share, pin/unpin, and leave are displayed in the conversation details

Actual Result:

The option to leave is only displayed after leaving a message to one of the threads and only on the IOU

Workaround:

Unknown

Platforms:

Screenshots/Videos

https://github.com/user-attachments/assets/b9119bf2-40ae-4606-8c94-e32e24859dcf

View all open jobs on GitHub

melvin-bot[bot] commented 2 hours ago

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.

IuliiaHerets commented 2 hours ago

@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

CyberAndrii commented 1 hour ago

Proposal

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

Leave option doesn't appear on invitee to a IOU thread

What is the root cause of that problem?

The BE sets the notification preference to CONST.REPORT.NOTIFICATION_PREFERENCE.HIDDEN, which causes the ReportUtils.canLeaveChat function to return false.

https://github.com/Expensify/App/blob/d009d8ed4830c7d0562c524c991b8a688e2b4869/src/pages/ReportDetailsPage.tsx#L249

https://github.com/Expensify/App/blob/d009d8ed4830c7d0562c524c991b8a688e2b4869/src/libs/ReportUtils.ts#L7547-L7549

This check was accidentally added in https://github.com/Expensify/App/pull/40529. Prior to this PR, the notification preference was not being checked: https://github.com/Expensify/App/pull/40529/files#diff-a85e40561837eb28d893b4b0087cb33a3f772ff4b3e082036ac882d74c545452L160-L162

After: https://github.com/Expensify/App/pull/40529/files#diff-577fcc5f3a5e4930916ff310e61c38edfa093792fe3ab55b9a30d2aecd8811dbR6480-R6482

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

Remove the following lines

https://github.com/Expensify/App/blob/d009d8ed4830c7d0562c524c991b8a688e2b4869/src/libs/ReportUtils.ts#L7547-L7549