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

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

Closed
2 of 6 tasks
IuliiaHerets opened this issue Sep 20, 2024 · 5 comments
Closed
2 of 6 tasks

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

IuliiaHerets opened this issue Sep 20, 2024 · 5 comments
Assignees
Labels
Bug Something is broken. Auto assigns a BugZero manager. Daily KSv2

Comments

@IuliiaHerets
Copy link

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:

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

Screenshots/Videos

Bug6608905_1726752874701.Recording__1044.mp4

View all open jobs on GitHub

@IuliiaHerets IuliiaHerets added Daily KSv2 Bug Something is broken. Auto assigns a BugZero manager. labels Sep 20, 2024
Copy link

melvin-bot bot commented Sep 20, 2024

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
Copy link
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

@CyberAndrii
Copy link
Contributor

CyberAndrii commented Sep 20, 2024

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

const shouldShowLeaveButton = ReportUtils.canLeaveChat(report, policy);

App/src/libs/ReportUtils.ts

Lines 7547 to 7549 in d009d8e

if (getReportNotificationPreference(report) === CONST.REPORT.NOTIFICATION_PREFERENCE.HIDDEN) {
return false;
}

Additionally, the report.type property is missing from the response (it is set to an empty string)

return (isChatThread(report) && !!getReportNotificationPreference(report)) || isUserCreatedPolicyRoom(report) || isNonAdminOrOwnerOfPolicyExpenseChat(report, policy);

App/src/libs/ReportUtils.ts

Lines 1127 to 1129 in d009d8e

function isChatThread(report: OnyxInputOrEntry<Report>): report is Thread {
return isThread(report) && report?.type === CONST.REPORT.TYPE.CHAT;
}

@joekaufmanexpensify
Copy link
Contributor

@IuliiaHerets could you share why you think this is a bug? It doesn't seem like one to me. Before you send a reply on the IOU thread, it's just a message in the parent chat room (rather than a thread in its own right that you can join/leave). So it makes sense to me that we add the leave button once the IOU message has a reply, as that's when it becomes a thread of it's own.

@joekaufmanexpensify
Copy link
Contributor

Closing for now as I think this is expected behavior.

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
Projects
None yet
Development

No branches or pull requests

3 participants