Closed lanitochka17 closed 2 months ago
Job added to Upwork: https://www.upwork.com/jobs/~013499a52b4634b0ed
Triggered auto assignment to @alexpensify (Bug
), see https://stackoverflow.com/c/expensify/questions/14418 for more details.
Platforms
in OP are ✅)Triggered auto assignment to Contributor-plus team member for initial proposal review - @getusha (External
)
from: @unicorndev-727
Room chat avatar is different for user who creates room & who has been invited to room
The root cause is that the user who has been invited to room doesn't have the policy data about workspace in Onyx so that the default workspace avatar will be showed. This issue only happens when we invite the user who isn't member of this workspace to the only room. https://github.com/Expensify/App/blob/8970aa3cd4ffc73cc59b9de3a50fd3d4da361f15/src/libs/ReportUtils.ts#L1247-L1249
It is a screen shot of the room owner. It is a screen shot of the room invited user.
We can send the policy update request if ONYXKEYS.COLLECTION.POLICY}${report?.policyID}
is null here.
Backend need to send the workspace data to the users who has been invited to the room and isn't the member of the workspace.
Room chat avatar is different for user who creates room and for user who has been invited to room
We're using the workspace avatar as the policy room avatar.
But when the user is invited to a policy room, but the user is not a member of that workspace, they don't have access to that information. That's expected because if user is not in the workspace, they shouldn't have access to the policy
record.
We had the same issue before with the workspace name, and fixed it by adding the policyName
as a field in the report
of the room.
We should do the same here for the workspace avatar, we need to add a policyAvatar
field in the report
record, which will be synced with the avatar of the workspace, the back-end will also need to be updated to support this.
Then in front-end we'll use that field as a fallback in case the policy avatar is not found. If even that policyAvatar
is not available, now we fallback to the default workspace avatar as we currently do.
This way, even though the user doesn't have any access to the workspace data, they can still access the policyAvatar
(beside policyName
) to display as room avatar.
NA
@getusha - - when you get a chance, can you review if this proposal will fix this issue? Thanks!
Heads up, I will be offline from Friday, December 22, to Thursday, January 4, 2024. I will not be actively watching over this GitHub during that period. If anything urgent is needed here, please ask for help in the #expensify-open-source Slack Room-- thanks!
@unicorndev-727 do you mind adding more details to the solution you mentioned in your proposal?
@unicorndev-727 do you mind adding more details to the solution you mentioned in your proposal?
In fact, this is the best place to call the backend API to allow workspace data to invited users who are not members of the workspace.
https://github.com/Expensify/App/blob/595bf4075988c0b64cb0db1e37694284637fbea2/src/libs/actions/Report.ts#L2165-L2175
Frontend is subscribted to policy data properly to get workspace icons here
https://github.com/Expensify/App/blob/595bf4075988c0b64cb0db1e37694284637fbea2/src/components/LHNOptionsList/LHNOptionsList.js#L117
and here
https://github.com/Expensify/App/blob/595bf4075988c0b64cb0db1e37694284637fbea2/src/libs/ReportUtils.ts#L1270.
But it doesn't work because we don't have the workspace data in ONYXKEYS.COLLECTION.POLICY
.
So we need to update inviteToRoom
API to share workspace data with the invited users who aren't member of the workspace by setting role to guest
in policy so that the guest can only read policy data like name, avatar and so on, I think.
type InviteToRoomParameters = {
reportID: string;
inviteeEmails: string[];
policyId: string;
role: string;
};
const parameters: InviteToRoomParameters = {
reportID,
inviteeEmails,
policyId: report.policyId,
role: 'guest'
};
API.write('InviteToRoom', parameters, {optimisticData, successData, failureData});
This prevents inconsistencies in policy updates and also ensures security.
@getusha what do you think about my proposal? We already do the same with the policyName
, and with that we don't need new authentication system for "guest" to access the workspace data as mentioned above.
@alexpensify, @getusha Uh oh! This issue is overdue by 2 days. Don't forget to update your issues!
📣 It's been a week! Do we have any satisfactory proposals yet? Do we need to adjust the bounty for this issue? 💸
@alexpensify, @getusha Still overdue 6 days?! Let's take care of this!
Reviewing proposals.
@getusha - I'm back online again. Any update regarding the proposals?
🎀 👀 🎀 Pulling up internal engineer to confirm if we can return workspace data (avatar) to a non-member user that joined a room and fix this on the backend initially.
Triggered auto assignment to @grgia, see https://stackoverflow.com/c/expensify/questions/7972 for more details.
@getusha looking into this
Internal convo link: https://expensify.slack.com/archives/C03TQ48KC/p1704412668387289
@alexpensify @grgia @getusha this issue was created 2 weeks ago. Are we close to approving a proposal? If not, what's blocking us from getting this issue assigned? Don't hesitate to create a thread in #expensify-open-source to align faster in real time. Thanks!
@alexpensify, @grgia, @getusha Whoops! This issue is 2 days overdue. Let's get this updated quick!
Current assignee @getusha is eligible for the Internal assigner, not assigning anyone new.
Thanks, @grgia for this update!
Looks like there is another PR to review here.
@alexpensify @getusha it looks like the PR opened by @grgia is the front-end part of this issue, which uses the same solution as my proposal. Just checking if I should be assigned here to open the PR instead since the back-end change was done (or if we go with the PR by @grgia, assigned for partial compensation)?
@getusha and @grgia - can we get your feedback here? Thanks!
@getusha or @grgia - any update here?
i think @grgia is OOO right now and she asked me to take this over. Just checking, if this should be handled by @dukenv0307 since he/she created the initial proposal or by me (or both?)...
I won't be able to work on the backend part, since i'm not an internal engineer but can give https://github.com/Expensify/App/pull/34115 a look
cc @alexpensify
Just checking, if this should be handled by @dukenv0307 since he/she created the initial proposal or by me (or both?)...
I'd be happy to take over the PR if @getusha also agrees the PR is implementing the solution in my proposal
Thanks, so we will wait for feedback from @getusha. Thanks!
@dukenv0307's proposal looks similar to the raised PR, either compensating partial bounty or other option works for me. the partial compensation sounds good to me, i'll wait for @grgia's input.
i'll wait for @grgia's input.
@alexpensify Looks like @grgia is OOO and was looking for someone to take over. I can take over if that's ok.
Or we can wait till @grgia 's back 👍
While testing these steps, the team discovered that the internal avatars were different. The steps are the same. Should we open a separate problem or relate it to this one? Thanks
https://github.com/Expensify/App/assets/78819774/c9393cd6-ecf1-435f-a61e-9d26af2a6563
Should we open a separate problem or relate it to this one?
@lanitochka17 It's not related (different root cause). I think we can create a new GH issue for that.
I agree to separate the GH issue, thanks!
@dukenv0307 if you'd like to open a new PR and do testing instead, that works as well. I can close my PR
@dukenv0307 if you'd like to open a new PR and do testing instead, that works as well. I can close my PR
@grgia sure I'm happy to do that.
@alexpensify would you mind assigning me to this issue to handle the front-end PR, thank you!
Done!
Daily update: waiting for the PR
@dukenv0307 don't forget to check https://github.com/Expensify/App/pull/34115#issuecomment-1889007115
@getusha This maybe BE bug since BE doesn't send the policyAvatar
correctly of the report to the invited user.
@grgia could you please check this https://github.com/Expensify/App/issues/33470#issuecomment-1926205427 on BE side? ty!
Weekly Update: On Hold, waiting for @grgia's feedback.
Weekly Update: I followed up in chat for help here.
@getusha could you please summarize where we're at with this issue and what questions are left outstanding. If there are BE changes required, I can make them
@getusha this PR is ready for preview.
@getusha could you please summarize where we're at with this issue and what questions are left outstanding. If there are BE changes required, I can make them
@grgia We have 2 issues related to this, more likely a BE bug.
github confused the PR linked to this issue as merged because another PR had commits it doesn't supposed to have, we've got a new PR now :)
Weekly Update: Waiting on feedback
@grgia any updates on these issues? https://github.com/Expensify/App/issues/33470#issuecomment-1957586801
I looked into this the other way it's been marked as internal but I don't think this is a high priority bug right now. What we will do is use the policyName
pattern as @dukenv0307 suggested for sharing the avatar (if any) as well.
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.15-4 Reproducible in staging?: Y Reproducible in production?: Y If this was caught during regression testing, add the test name, ID and link from TestRail: Email or phone of affected tester (no customers): Logs: https://stackoverflow.com/c/expensify/questions/4856 Expensify/Expensify Issue URL: Issue reported by: Applause - Internal Team Slack conversation:
Action Performed:
Expected Result:
Room chat avatar must be same for user who creates room and for user who has been invited to room
Actual Result:
Room chat avatar is different for user who creates room and for user who has been invited to room
Workaround:
Unknown
Platforms:
Which of our officially supported platforms is this issue occurring on?
Screenshots/Videos
Add any screenshot/video evidence
https://github.com/Expensify/App/assets/78819774/fbc7a3bd-7ef8-4165-83c4-072d8c245c11
View all open jobs on GitHub
Upwork Automation - Do Not Edit
Issue Owner
Current Issue Owner: @grgia