Repository navigation
[No QA][Sentry] ReasonAttributes passed from skeletons to sentry - #81706
Conversation
| ); | ||
|
|
||
| return () => endSpan(spanId); | ||
| // eslint-disable-next-line react-hooks/exhaustive-deps -- intentionally removing reasonAttributes to prevent re-creating the span on every render if the parameters are unstable |
There was a problem hiding this comment.
Wouldn't we only capture initial attributes here? Can we use setAttributes in case attributes change and just update the span instead of re-creating it?
There was a problem hiding this comment.
bump on my question above @sosek108 please. I'm worried initial values might not help much. Unless I'm missing something?
There was a problem hiding this comment.
Actually, I just found out about addEvent - what do you think of the following:
const spanId = `${CONST.TELEMETRY.SPAN_SKELETON}_${component}_${reactId}`;
// Update attributes when they change
useEffect(() => {
const span = getSpan(spanId);
if (span && reasonAttributes) {
const namespacedAttributes = Object.fromEntries(Object.entries(reasonAttributes).map(([key, value]) => [`${CONST.TELEMETRY.ATTRIBUTE_SKELETON_PREFIX}${key}`, value]));
span.setAttributes(namespacedAttributes);
span.addEvent('skeleton_attributes_updated', namespacedAttributes);
}
}, [reasonAttributes, spanId]);
There was a problem hiding this comment.
Sorry @youssef-lr, I've lost in other tasks and had no time to check your comment.
addEvent is quite good idea. I'll investigate this
There was a problem hiding this comment.
I've pushed changes with second useEffect that will handle span event creation
There was a problem hiding this comment.
I've tested this and I see no events in my span :/
dummy test was to add timeout to modify reasonAttributes every second.
This is response from AI:
The Problem: Inactive Spans + Events
You're using startInactiveSpan() which creates spans that aren't tied to the current execution context. Span events (addEvent()) have limited or no support with inactive spans in Sentry SDK v7.
Why Events Aren't Showing
- Inactive spans are primarily designed for manual span creation/tracking
- Events on inactive spans may not be serialized or sent to Sentry
- The Sentry UI may not display events for inactive spans even if captured
To be verified
There was a problem hiding this comment.
Posted question on their discord https://discord.com/channels/621778831602221064/1470754422048166053/1470754422048166053
Codecov Report✅ Changes either increased or maintained existing code coverage, great job!
|
|
No product review needed |
|
I'll take a look at this PR soon |
Reviewer Checklist
Screenshots/VideosAndroid: HybridAppNot available Android: mWeb ChromeNot available iOS: HybridAppNot available iOS: mWeb SafariNot available MacOS: Chrome / SafariNot available |
suneox
left a comment
There was a problem hiding this comment.
Overall, the change set to repair the structure LGTM
|
I pushed one simple change to the typing of @youssef-lr because we don't know when we get answers about getEvent I propose we merge this and start the refactoring effort. I'd really use this info in my current investigation |
|
@sosek108 looks like this commit is not signed
|
10f9725 to
037a28c
Compare
10f9725 to
dbb27b7
Compare
# Conflicts: # src/CONST/index.ts
done. I naively trusted browser's "Resolve conflict". Had to do some force pushes unfortunately, but last commit was pushed normal way so checks are triggered correctly |
|
Yeah no worries about force pushing. Would have recommended the same! |
|
🚧 @youssef-lr has triggered a test Expensify/App build. You can view the workflow run here. |
|
🧪🧪 Use the links below to test this adhoc build on Android, iOS, and Web. Happy testing! 🧪🧪
|
|
✋ This PR was not deployed to staging yet because QA is ongoing. It will be automatically deployed to staging after the next production release. |
|
🚀 Deployed to staging by https://github.com/youssef-lr in version: 9.3.18-0 🚀
|
|
🚀 Deployed to production by https://github.com/lakchote in version: 9.3.18-8 🚀
|

Explanation of Change
This PR adds
reasonAttributestouseSkeletonSpansand skeletons that use this hook.Fixed Issues
$ #81683
PROPOSAL:
Tests
Offline tests
QA Steps
// TODO: These must be filled out, or the issue title must include "[No QA]."
PR Author Checklist
### Fixed Issuessection aboveTestssectionOffline stepssectionQA stepssectioncanBeMissingparam foruseOnyxtoggleReportand 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