-
Notifications
You must be signed in to change notification settings - Fork 3k
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
Fix WS name and avatar are not updated dynamically in the chat #49403
Fix WS name and avatar are not updated dynamically in the chat #49403
Conversation
@@ -1955,7 +1955,7 @@ function getWorkspaceIcon(report: OnyxInputOrEntry<Report>, policy?: OnyxInputOr | |||
const iconFromCache = workSpaceIconsCache.get(cacheKey); | |||
// disabling to protect against empty strings | |||
// eslint-disable-next-line @typescript-eslint/prefer-nullish-coalescing | |||
const policyAvatarURL = report?.policyAvatar || allPolicies?.[`${ONYXKEYS.COLLECTION.POLICY}${report?.policyID}`]?.avatarURL; | |||
const policyAvatarURL = allPolicies?.[`${ONYXKEYS.COLLECTION.POLICY}${report?.policyID}`]?.avatarURL || report?.policyAvatar; |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
However, the Pusher only updates the policy.avatarURL, but doesn't send the updated policyAvatar. But if we look at the LHN, the avatar is updated, that's because we use caching for the avatar. The announce room of the workspace doesn't have policyAvatar, so it will use the updated policy.avatarURL and save it to the cache. When the LHN tries to get the avatar, the cache is available, so it shows the updated avatar.
As explained in my proposal, the LHN ws avatar is updated because the announce room of the workspace doesn't have policyAvatar
, so it fallbacks to the policy.avatarURL
, but I just recheck and now the announce room has the policyAvatar
. So, I updated the fallback here
Reviewer Checklist
Screenshots/VideosMacOS: Chrome / Safari49403-web-safari-001.mp4MacOS: Desktop49403-desktop-001.mp4iOS: mWeb Safari49403-mweb-safari-001.mp4Android: Native49403-android-native-001.mp4Android: mWeb Chrome49403-mweb-chrome-001.mp4iOS: Native49403-ios-native-001.mp4 |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Thanks @bernhardoj.
LGTM and works well too.
@neil-marcellini Over to you for review. Thanks
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Other than the ESLint checks to fix, it looks great. Thanks.
@bernhardoj please fix the conflicts and ESLint checks, then I think we can merge |
Conflict fixed. |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
More conflicts, then we can merge. Please DM me when fixed.
@neil-marcellini Fixed. DM'd you in Slack. |
🚀 Deployed to staging by https://github.com/neil-marcellini in version: 9.0.41-1 🚀
|
🚀 Deployed to production by https://github.com/jasperhuangg in version: 9.0.41-10 🚀
|
Details
In the WS chat, the WS avatar and name are not updated dynamically.
Fixed Issues
$ #48710
PROPOSAL: #48710 (comment)
Tests
Same as QA Steps
Offline tests
Same as QA Steps
QA Steps
Device 1 & 2 logged in as the same user
PR Author Checklist
### Fixed Issues
section aboveTests
sectionOffline steps
sectionQA steps
sectiontoggleReport
and notonIconClick
)myBool && <MyComponent />
.src/languages/*
files and using the translation methodSTYLE.md
) were followedAvatar
, I verified the components usingAvatar
are working as expected)StyleUtils.getBackgroundAndBorderStyle(theme.componentBG)
)Avatar
is modified, I verified thatAvatar
is working as expected in all cases)Design
label and/or tagged@Expensify/design
so the design team can review the changes.ScrollView
component to make it scrollable when more elements are added to the page.main
branch was merged into this PR after a review, I tested again and verified the outcome was still expected according to theTest
steps.Screenshots/Videos
Android: Native
android.mp4
Android: mWeb Chrome
android.mweb.mp4
iOS: Native
ios.mp4
iOS: mWeb Safari
ios.mweb.mp4
MacOS: Chrome / Safari
web.mp4
MacOS: Desktop
desktop.mp4