Add new span for FAB add report to Scan Page#87765
Add new span for FAB add report to Scan Page#87765rinej wants to merge 4 commits intoExpensify:mainfrom
Conversation
|
@cretadn22 @cristipaval One of you needs to 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] |
There was a problem hiding this comment.
💡 Codex Review
Here are some automated review suggestions for this pull request.
Reviewed commit: 9932964686
ℹ️ 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".
| // Cancel entry-to-scan spans if they haven't ended naturally | ||
| cancelSpan(CONST.TELEMETRY.SPAN_ENTRY_TO_SCAN_NAVIGATION); | ||
| cancelSpan(CONST.TELEMETRY.SPAN_ENTRY_TO_SCAN_READY); | ||
| cancelSpan(CONST.TELEMETRY.SPAN_ENTRY_TO_SCAN); |
There was a problem hiding this comment.
Cancel entry-to-scan spans on permission denial
SPAN_ENTRY_TO_SCAN_READY and SPAN_ENTRY_TO_SCAN are only canceled in the unmount cleanup, so in the denied/blocked/unavailable permission path they stay active as long as the user remains on the Scan screen. That means a user who waits on the permission UI can produce inflated durations (or effectively never-finished spans), which skews the new FAB→Scan telemetry. The permission-status effect already cancels SPAN_OPEN_CREATE_EXPENSE; these new entry spans should be canceled there as well to keep measurements consistent.
Useful? React with 👍 / 👎.
There was a problem hiding this comment.
added the change and also resolved the conflicts
…ab-sentry-spans # Conflicts: # src/CONST/index.ts
|
Does this require C+ review? If so is it possible for C+ to access the Sentry logs for this? |
I'm not sure about it. I know that for the previous span additions @rlinoz was testing it, maybe you could help here as well? |
|
yes, C+ has access to sentry |
|
@mkhutornyi We do, but do we have the permissions to create traces? |
Not sure what you mean. We send data to Sentry through the app with sentry log enabled and then we should see logs in sentry dashboard. |
|
I meant on dev, it wasn't sending the logs but let me see if I can get it going. |
Try Troubleshoot > Switch |
|
Yep you can send spans from dev by doing the above. |
|
Ah great, thanks! |
Reviewer Checklist
Screenshots/VideosAndroid: HybridAppAndroid: mWeb ChromeiOS: HybridAppiOS: mWeb SafariMacOS: Chrome / Safari |
|
@rinej Are we supposed to have a
|
|
Thanks for the input Olly! On web, readiness is handled via the browser’s onUserMedia callback, which is generally faster and more predictable -so we just close the parent span on mount We can add the extra logic to support a similar span on web as well. |

Explanation of Change
We need proper Sentry instrumentation for the Camera FAB → Scan page transition. Specifically, a parent span measuring the full time from FAB tap to camera ready, with two subspans:
In the PR I added a new dedicated Sentry span ManualEntryToScan with two subspans (ManualEntryToScanNavigation for FAB tap → Scan page mount, and ManualEntryToScanReady for Scan page mount → camera ready) to measure the Camera FAB → Scan page flow. The spans use a generic source attribute (camera_fab) so the same instrumentation can be reused for Global Create and Quick Action entry points without adding new constants. Both coexist with the existing ManualOpenCreateExpense span - no changes to current dashboards
Fixed Issues
$ #87854
PROPOSAL:
Tests
Web
ManualEntryToScanspan appears with:source: camera_fabplatform: webManualEntryToScanNavigationManualEntryToScanReadyNative (iOS / Android)
ManualEntryToScanspan appears with:source: camera_fabplatform: ios/androidManualEntryToScanNavigationends on page mountManualEntryToScanReadyends when the camera is readyNon-FAB Entry
ManualEntryToScanspan is createdManualOpenCreateExpensefires (unchanged behavior)Offline tests
QA Steps
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