Repository navigation
[No QA] Add reasonAttributes to AvatarSkeleton usage sites - #83692
youssef-lr merged 1 commit into
Conversation
There was a problem hiding this comment.
💡 Codex Review
Here are some automated review suggestions for this pull request.
Reviewed commit: 72189ef998
ℹ️ About Codex in GitHub
Codex has been enabled to automatically review pull requests in this repo. Reviews are triggered when you
- Open a pull request for review
- Mark a draft as ready
- Comment "@codex review".
If Codex has suggestions, it will comment; otherwise it will react with 👍.
When you sign up for Codex through ChatGPT, Codex can also answer questions or update the PR, like "@codex address that feedback".
| <View style={[styles.sidebarAvatar]}> | ||
| {isLoading ? ( | ||
| <AvatarSkeleton /> | ||
| <AvatarSkeleton reasonAttributes={{context: 'AvatarWithIndicator', isLoading}} /> |
There was a problem hiding this comment.
Memoize skeleton reasonAttributes objects
Passing an inline reasonAttributes object here causes a new reference on every render, and useSkeletonSpan reacts to that by calling span.setAttributes and span.addEvent on every rerender (src/libs/telemetry/useSkeletonSpan.ts:56-65), even when the values did not change. While the avatar is loading, normal rerenders (theme/Onyx/layout updates) can therefore generate noisy telemetry and extra span work that obscures true infinite-loading signals; the same pattern is also introduced in ProfilePage and should be memoized/hoisted there as well.
Useful? React with 👍 / 👎.
|
@sosek108 Anything for me to test here? Sounds like it should be |
|
@jjcoffee Thanks, you're right - NoQA ;) no need for your assistance |
Reviewer Checklist
Screenshots/VideosAndroid: HybridAppAndroid: mWeb ChromeiOS: HybridAppiOS: mWeb SafariMacOS: Chrome / Safari |
jjcoffee
left a comment
There was a problem hiding this comment.
No QA so blind approving to get a CME assigned!
|
🚧 @youssef-lr has triggered a test Expensify/App build. You can view the workflow run here. |
|
✋ This PR was not deployed to staging yet because QA is ongoing. It will be automatically deployed to staging after the next production release. |
|
🧪🧪 Use the links below to test this adhoc build on Android, iOS, and Web. Happy testing! 🧪🧪
|
|
🚀 Deployed to staging by https://github.com/youssef-lr in version: 9.3.31-0 🚀
|
|
🚀 Deployed to production by https://github.com/blimpich in version: 9.3.31-12 🚀
|
Explanation of Change
Two
AvatarSkeletonusage sites were missing thereasonAttributesprop, which is used to capture debugging context when an infinite skeleton loading state is reported in Sentry. This change addsreasonAttributesto both sites:AvatarWithIndicator.tsx: passescontext: 'AvatarWithIndicator'and the currentisLoadingboolean value so it is clear which component triggered the skeleton and what the loading state was.ProfilePage.tsx: passescontext: 'ProfilePage'along with the three boolean conditions that control whether the skeleton is shown —isPersonalDetailsEmpty,isAccountIDInvalid, andhasNoAvatarURL— so that the exact cause of a stuck skeleton can be identified from Sentry data alone.Fixed Issues
$ #83396
PROPOSAL:
Tests
Offline tests
N/A
QA Steps
Same as tests
PR Author Checklist
### Fixed Issuessection aboveTestssectionOffline stepssectionQA stepssectiontoggleReportand notonIconClick)src/languages/*files and using the translation methodSTYLE.md) were followedAvatar, I verified the components usingAvatarare working as expected)StyleUtils.getBackgroundAndBorderStyle(theme.componentBG))npm run compress-svg)Avataris modified, I verified thatAvataris working as expected in all cases)Designlabel and/or tagged@Expensify/designso the design team can review the changes.ScrollViewcomponent to make it scrollable when more elements are added to the page.mainbranch was merged into this PR after a review, I tested again and verified the outcome was still expected according to theTeststeps.Screenshots/Videos
Android: Native
Android: mWeb Chrome
iOS: Native
iOS: mWeb Safari
MacOS: Chrome / Safari