[No QA] Revert network Sentry spans to reduce 429 rate limiting#83924
[No QA] Revert network Sentry spans to reduce 429 rate limiting#83924roryabraham wants to merge 2 commits intomainfrom
Conversation
Codecov Report❌ Looks like you've decreased code coverage for some files. Please write tests to increase, or at least maintain, the existing level of code coverage. See our documentation here for how to interpret this table.
|
|
@ZhenjaHorbach 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] |
78dba45 to
4558e62
Compare
There was a problem hiding this comment.
💡 Codex Review
Here are some automated review suggestions for this pull request.
Reviewed commit: 4558e62d4c
ℹ️ 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".
| span.setStatus({code: 2, message: error instanceof Error ? error.message : undefined}); | ||
| span.end(); | ||
| }); | ||
| Onyx.update(optimisticData); |
There was a problem hiding this comment.
Handle rejected optimistic Onyx updates
This change drops the rejection handler that previously wrapped Onyx.update(optimisticData), and the promise is still fire-and-forget. If Onyx.update rejects (for example due to invalid optimistic payload shape or persistence-layer errors), it now becomes an unhandled promise rejection instead of being contained, which can surface as global errors and noisy crash reporting in production.
Useful? React with 👍 / 👎.
| queueFlushedDataLength: queueFlushedData.length, | ||
| }); | ||
| return Onyx.update(queueFlushedData).then(() => { | ||
| Onyx.update(queueFlushedData).then(() => { |
There was a problem hiding this comment.
Catch failures when applying flushed queue updates
The queue-flush path no longer returns or catches the Onyx.update(queueFlushedData) promise, so a storage failure here now escapes as an unhandled rejection and clearQueueFlushedData() never runs. This is a regression from the previous flow, which attached a .catch(...) to the flush chain, and it can leave queued updates stuck while emitting global async errors.
Useful? React with 👍 / 👎.
Explanation of Change
Reverts #82731 which added Sentry performance spans across the networking pipeline (SequentialQueue, middleware pipeline, OnyxUpdates, RequestThrottle, etc.).
These spans are causing Sentry to rate-limit our app with 429 Too Many Requests errors, which means we're losing important error and performance data. Furthermore, prod data shows that nearly all of these spans are sub-millisecond (except the OnyxUpdates span at P95 6.5ms), so they're not providing useful performance insights relative to the cost of the additional span volume.
Fixed Issues
$ #83923
Tests
Offline tests
N/A — this is a revert of observability instrumentation. No user-facing behavior changes.
QA Steps
No QA — this reverts internal Sentry instrumentation only. No user-facing behavior changes.
PR Author Checklist
### Fixed Issuessection aboveTestssectionOffline stepssectionQA stepssectiontoggleReportand notonIconClick)src/languages/*files and using the translation methodAvatar, 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
N/A — no UI changes. This is a revert of internal instrumentation code only.
Made with Cursor