Cancel ManualSendMessage spans when report is loading#95559
Conversation
Codecov Report✅ Changes either increased or maintained existing code coverage, great job!
|
|
@codex review |
|
Codex Review: Didn't find any major issues. Keep it up! Reviewed commit: ℹ️ About Codex in GitHubCodex has been enabled to automatically review pull requests in this repo. Reviews are triggered when you
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". |
|
@eVoloshchak Please copy/paste the Reviewer Checklist from here into a new comment on this PR and complete it. If you have the K2 extension, you can simply click: [this button] |
Reviewer Checklist
Screenshots/VideosAndroid: HybridAppAndroid: mWeb ChromeiOS: HybridAppScreen.Recording.2026-07-10.at.12.41.23.moviOS: mWeb SafariMacOS: Chrome / SafariScreen.Recording.2026-07-10.at.12.09.27.movScreen.Recording.2026-07-10.at.12.05.15.movScreen.Recording.2026-07-10.at.12.02.13.mov |
|
🚧 cristipaval 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/cristipaval in version: 9.4.33-0 🚀
|
|
🤖 Help site review: no changes required I reviewed the changes in this PR against the help site articles under Why: This PR is purely internal Sentry telemetry/observability instrumentation. It cancels
As the PR itself notes, the composer is unchanged and there is no change to any user-facing behavior, UI, feature name, tab, setting, or button. Help site articles document customer-facing product behavior, and nothing a user sees or does changes here. @LukasMod, no help site PR was created since this is internal telemetry only. If you believe a customer-facing behavior did change and warrants a docs update, let me know and I'll draft one. |
Explanation of Change
The
ManualSendMessagespan measures time from pressing Send until the sent message renders(
TextCommentFragmentmounts). If a message is sent while the report-actions list is still showing a skeleton, the message can't render yet, so the span is blocked by other loading conditions.Fix: while a report-actions skeleton is on screen, we now listen for
ManualSendMessagespans started forthat report and cancel them immediately.
useCancelSendMessageSpanOnSkeleton— subscribes to Sentry'sspanStartwhile mounted; cancels spansmatching the report's
report_id, tagging them withcanceled_by_skeletonattribute.ReportActionsLoadingSkeleton— thin wrapper rendered wherever a report-actions skeleton shows (inReportActionsandReportActionsSkeletonGuard); hosts the hook and passes theskeletonName.activeSpans.cancelSpanByInstance— cancels a span by its Sentry instance (the listener only has the rawspan, not the id).
Cancelled spans get:
canceled: true,canceled_by_skeleton: <name>(report_actions_report_data_loading,report_actions_app_load,skeleton_guard_loading, orskeleton_guard_derived_timing). Normal sends areuntouched and end with
finished_manually: true.Fixed Issues
$ #95583
PROPOSAL:
Tests
The app logs each span to the console. In DevTools Console, filter by
ManualSendMessage. Each spanprints a Starting span line and an Ending span line; expand the attributes object on the ending line
to read
canceled,canceled_by_skeleton,report_idTest 1 — sending while loading (span is cancelled)
ManualSendMessage), verify each span's Ending span attributes have:canceled: truecanceled_by_skeletonset to a skeleton name (e.g.skeleton_guard_loadingfor Concierge)report_id= the open report's IDManualSendMessagespan remains.Test 2 — sending with no loading (works as before)
ManualSendMessagespan's Ending span attributes have:canceledand nocanceled_by_skeletonreport_idpresentTest 3 — loaded Concierge + freshly opened chat, only the loading one is affected
ManualSendMessagespan iscanceledwith
canceled_by_skeletonandreport_id= that chat.no
canceled/canceled_by_skeleton,Offline tests
QA Steps
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.mov
Android: mWeb Chrome
iOS: Native
ios.mov
iOS: mWeb Safari
MacOS: Chrome / Safari
web.mov