App
App copied to clipboard
Thread - Unable to invite user to thread when the thread originates from group chat
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: 1.4.58-4 Reproducible in staging?: Y Reproducible in production?: N If this was caught during regression testing, add the test name, ID and link from TestRail: N/A Issue reported by: Applause - Internal Team
Action Performed:
- Go to staging.new.expensify.com
- Go to FAB > Start chat
- Create a group chat with two users
- Send a message in group chat
- Right click on message > Reply in thread
- Click on the thread header > Members
- Invite any user
Expected Result:
User is invited successfully
Actual Result:
User is not invited to the thread when the thread originates from group chat. The member count changes from 2 back to 1.
Workaround:
Unknown
Platforms:
Which of our officially supported platforms is this issue occurring on?
- [x] Android: Native
- [x] Android: mWeb Chrome
- [x] iOS: Native
- [x] iOS: mWeb Safari
- [x] MacOS: Chrome / Safari
- [x] MacOS: Desktop
Screenshots/Videos
Add any screenshot/video evidence
https://github.com/Expensify/App/assets/78819774/1b9be08a-2fe7-4665-8bfd-780b53102567
:wave: Friendly reminder that deploy blockers are time-sensitive ⏱ issues! Check out the open `StagingDeployCash` deploy checklist to see the list of PRs included in this release, then work quickly to do one of the following:
- Identify the pull request that introduced this issue and revert it.
- Find someone who can quickly fix the issue.
- Fix the issue yourself.
Triggered auto assignment to @arosiclair (DeployBlockerCash
), see https://stackoverflowteams.com/c/expensify/questions/9980/ for more details.
We think that this bug might be related to #vip-vsp
@arosiclair 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
Response from backend:
{"jsonCode":401,"message":"401 Group Chats should use InviteToGroupChat command","onyxData":[],"requestID":"xxx"}
Proposal
Please re-state the problem that we are trying to solve in this issue.
Unable to invite user to thread when the thread originates from group chat
What is the root cause of that problem?
The backend returns 401 Group Chats should use InviteToGroupChat command
when inviting members in a thread that originates from a group chat.
What changes do you think we should make in order to solve the problem?
we need to make the invite room command conditional on whether the parent report is a group chat or not, if its a group chat then we need to send InviteToGroupChat
instead of InviteToRoom
.
to achieve that we need to add a new write command InviteToGroupChat
here:
INVITE_TO_GROUP_CHAT: 'InviteToGroupChat',
then inside the inviteToRoom
function in the Report.ts file, we need to change this to:
const parentReport = currentReportData?.[report.parentReportID];
const isParentReportGroupChat = ReportUtils.isGroupChat(parentReport);
API.write(isParentReportGroupChat ? WRITE_COMMANDS.INVITE_TO_GROUP_CHAT : WRITE_COMMANDS.INVITE_TO_ROOM, parameters, {optimisticData, successData, failureData});
I reproduced on staging and prod v1.4.57-5 so this is not a blocker
Triggered auto assignment to @adelekennedy (Bug
), see https://stackoverflow.com/c/expensify/questions/14418 for more details.
I think this probably should be internal but I'm not sure. @marcaaron I saw your name on InviteToRoom
and InviteToGroupChat
. What do you think? Not sure if those can be used for threads too.
This depends on the outcome of https://expensify.slack.com/archives/C066HJM2CAZ/p1712005980413999
I'm not sure if we intentionally designed this feature to work any kind of way, but proposed a couple of paths forward in that thread.
Gonna stay assigned here so I don't lose the context here. But maybe let's remove the Bug
label for now as well until we have chosen a direction.
@marcaaron Whoops! This issue is 2 days overdue. Let's get this updated quick!
I'm gonna close this one in favor of https://github.com/Expensify/Expensify/issues/384761
That lays out in clearer terms how this feature should work.