Open IuliiaHerets opened 1 month ago
Triggered auto assignment to @slafortune (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.
We think that this bug might be related to #wave-collect - Release 1
@slafortune 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
Custom workspace avatar is displayed in the quick action button when user change the workspace avatar to default. Avatar doesn't get removed not only on the QAB but also for the workspace chat also.
When we remove the avatar of the policy, report. policyAvatar
hasn't changed. It leads after we remove the avatar, isSameAvatarURL
still true
then we return the policy avatar from workSpaceIconsCache
which is still old policy avatar
When we get the policyAvatarURL
here, we should check if the policy still exists we should prioritize the avatarURL
of policy first
const reportPolicy = policy ?? allPolicies?.[`${ONYXKEYS.COLLECTION.POLICY}${report?.policyID}`];
// disabling to protect against empty strings
// eslint-disable-next-line @typescript-eslint/prefer-nullish-coalescing
const policyAvatarURL = reportPolicy ? reportPolicy?.avatarURL : report?.policyAvatar;
We have some other solutions like updating policyAvatar
to empty for all related reports of the workspace when we remove the custom avatar or we can update workSpaceIconsCache
of the policy to the default icon when we delete the custom avatar.
📣 @1234abd! 📣 Hey, it seems we don’t have your contributor details yet! You'll only have to do this once, and this is how we'll hire you on Upwork. Please follow these steps:
Contributor details
Your Expensify account email: <REPLACE EMAIL HERE>
Upwork Profile Link: <REPLACE LINK HERE>
Job added to Upwork: https://www.upwork.com/jobs/~021838248313041984995
Triggered auto assignment to Contributor-plus team member for initial proposal review - @situchan (External
)
I think this is more a backend issue, where the
the report?.policyAvatar
doesnt update on policy avatar removal.
FYI: the report?.policyAvatar
was introduced to solve this issue https://github.com/Expensify/App/issues/33470, so i think the safest solution would be to fix it from the backend
📣 @hayes102! 📣 Hey, it seems we don’t have your contributor details yet! You'll only have to do this once, and this is how we'll hire you on Upwork. Please follow these steps:
Contributor details
Your Expensify account email: <REPLACE EMAIL HERE>
Upwork Profile Link: <REPLACE LINK HERE>
Thanks for the proposals. Please explain in root cause why this bug only happens in QAB.
@situchan This bug also happens for policy-related reports like the video below. The old policy avatar displays briefly until the OpenReport
API is complete that update policyAvatar
to empty.
https://github.com/user-attachments/assets/29cdc6b6-1359-4241-a2f9-3235c2932406
I am inclined to https://github.com/Expensify/App/issues/49448#issuecomment-2369231324. Can we fix this in backend? 🎀👀🎀
Triggered auto assignment to @luacmartins, see https://stackoverflow.com/c/expensify/questions/7972 for more details.
@situchan When we update the avatar of the workspace back-end update the policyAvatar
of the report but this will not be returned in the response because maybe we can have many related reports for a workspace. Then when we open a related report this field will be updated. So I think we should update the way we get the avatar in frontend.
cc @luacmartins
This is yet another example of duplicated data causing issues. Can we use the data in the policy_
key instead?
@luacmartins Yes that is what I proposed.
Yea, I think we should be using that. FWIW we have a way to retrieve non-member policy data, so I'm not even sure why we added policyAvatar to the report key as this also goes against our principles of keeping DB and Onyx data the same cc @techievivek
@luacmartins I think we used policyAvatar
for the case the policy is deleted
@slafortune, @luacmartins, @situchan Uh oh! This issue is overdue by 2 days. Don't forget to update your issues!
@techievivek kind bump https://github.com/Expensify/App/issues/49448#issuecomment-2372636151
Yea, I think we should be using that. FWIW we have a way to retrieve non-member policy data, so I'm not even sure why we added policyAvatar to the report key as this also goes against our principles of keeping DB and Onyx data the same
I see, I wasn’t aware we already had a method to retrieve policy data for non-members. Since that's the case, I agree we should use that instead of introducing a new field. It also seems that adding the avatar to reports follows a similar approach to when we added the policyName field https://github.com/Expensify/App/pull/37003/files#diff-5f549daaaaca967d763b3671e371465143185bab398c16825ff9cb2d41a7de7fL120, which also goes against the principle of keeping the DB and Onyx data consistent. Should we look into that as well?
Yes, I think we should
📣 It's been a week! Do we have any satisfactory proposals yet? Do we need to adjust the bounty for this issue? 💸
@slafortune @luacmartins @situchan 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!
@slafortune, @luacmartins, @situchan Uh oh! This issue is overdue by 2 days. Don't forget to update your issues!
@situchan @luacmartins is there a proposal that will work - or an update?
I think there's a bit of internal work that needs to be done before we can change anything in App itself. @techievivek are you able to work on these changes?
@luacmartins This only requires a frontend change, right? As you mentioned, we already sent all those details via the backend, so can we not pass this to an external contributor via this GH? Or do we need some other backend changes as well?
Do non-members already have access to that data? If they do, then I agree we only need FE changes.
📣 It's been a week! Do we have any satisfactory proposals yet? Do we need to adjust the bounty for this issue? 💸
@slafortune, @luacmartins, @situchan Whoops! This issue is 2 days overdue. Let's get this updated quick!
@mkzie2 can you please confirm that your solution works for non-members and share video?
@situchan Here is the video. In the video, I invited a user who isn't a member of the WS to the WS chat via mention, and the avatar is displayed correctly. In this case, the invited user will not have the data of the policy and it's used policyAvatar
from report data to display
https://github.com/user-attachments/assets/6d9e26c8-b6d0-4bf7-b569-b8b4c140d0aa
it's used
policyAvatar
from report data to display
So it's outdated avatar, which is wrong
📣 It's been a week! Do we have any satisfactory proposals yet? Do we need to adjust the bounty for this issue? 💸
QAB - Workspace avatar remains custom when change do default
We are using outdated avatar from report?.policyAvatar
report?.policyAvatar
originally created to get policy avatar url because at the time PR created, non-member user doesn't have information about the URL https://github.com/Expensify/App/issues/33470#issuecomment-1867249606, but then this solution will cause synchronization issue.
Since we can now access the policy avatarUrl even when someone is not the member of a workspace, we can revert this PR https://github.com/Expensify/App/pull/35792 and replace all report.policyAvatar
usage to policy.avatarUrl
N/A
Since we can now access the policy avatarUrl even when someone is not the member of a workspace
@wildan-m can you please double check? Please also share test steps where non-member can see workspace. Also make sure that reverting doesn't cause original bug
@situchan thanks for your comment, I've tried with fresh account and it's not working as expected, (maybe previously working because of cache) seems BE is not returning any info for non member.
FWIW we have a way to retrieve non-member policy data
@luacmartins @techievivek do we need to call some functions to fill that data? I think it will be automatically populated with nonmember info at the time someone invited?
So it's outdated avatar, which is wrong
@situchan
policyAvatar
is updated if we refresh the page. To keep it up to date, we need to send the pusher data when we update the WS avatar. Nonmembers are required to use policyAvatar
because they don't have policy
data. @slafortune @luacmartins @situchan this issue is now 4 weeks old, please consider:
Thanks!
Do non-members already have access to that data? If they do, then I agree we only need FE changes.
can we get correct answer? I don't think they have access. cc: @luacmartins @techievivek
@situchan we can probably test this in the frontend by logging in and seeing what kind of data a non-member gets once they try to join a policy.
@luacmartins I've tried that, no data on the initial invite https://github.com/Expensify/App/issues/49448#issuecomment-2413068913
@luacmartins We have two types of none-member:
policyDetailsForNonMembers
policy
data and we use report.policyAvatar
to display the avatar of the report.How can non member request join if they can't access the WS page? is it only for public room?
One way that I know of is via an invite link
The user is invited to a WS chat of a member via mention, this user doesn't have policy data and we use report.policyAvatar to display the avatar of the report.
Hmm it seems like we'd need some backend changes to accommodate for this.
📣 It's been a week! Do we have any satisfactory proposals yet? Do we need to adjust the bounty for this issue? 💸
@slafortune, @luacmartins, @situchan Whoops! This issue is 2 days overdue. Let's get this updated quick!
Haven't been able to look into this. @techievivek do you have bandwidth to take the internal part of this issue?
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: Email or phone of affected tester (no customers): gocemate+a2177@gmail.com Issue reported by: Applause Internal Team
Action Performed:
Expected Result:
Default workspace avatar should be displayed in the quick action button
Actual Result:
Custom workspace avatar is displayed in the quick action button when user change the workspace avatar to default. Avatar doesn't get removed not only on the QAB but also for the workspace chat also.
Workaround:
Unknown
Platforms:
Screenshots/Videos
https://github.com/user-attachments/assets/7ba18b69-148b-4f61-9332-c5cb3f610240
View all open jobs on GitHub
Upwork Automation - Do Not Edit
Issue Owner
Current Issue Owner: @c3024