Skip to content

feat: sentry error monitoring for quick buy and top traders#30409

Merged
Bigshmow merged 10 commits into
mainfrom
TSA-150-sentry-error-monitoring
May 25, 2026
Merged

feat: sentry error monitoring for quick buy and top traders#30409
Bigshmow merged 10 commits into
mainfrom
TSA-150-sentry-error-monitoring

Conversation

@Bigshmow
Copy link
Copy Markdown
Contributor

@Bigshmow Bigshmow commented May 19, 2026

Description

Adds feature:social Sentry error instrumentation for Top Traders and Quick Buy, following existing Logger.error` + tags pattern.

  • New helpers in socialServiceTelemetry.ts: buildSocialLoggerErrorOptions, formatSocialExtraMessage, SOCIAL_SENTRY_FEATURE
  • Top Traders: leaderboard fetch/refresh + pull-to-refresh (useTopTraders, TopTradersView)
  • Quick Buy: quote fetch + submit tx (useQuickBuyQuotes, useQuickBuyBottomSheet)
  • more WIP...

Events are sent via existing Logger.error > Sentry on release builds (metrics opt-in, DSN). Search in Sentry: feature:social, surface:top_traders, surface:quick_buy.
Sentry alert rules (Slack/email on feature:social) are out of scope for this PR and will be configured separately.

Out of scope (follow-up)

  • feature:ai for digests / market insights

Changelog

CHANGELOG entry: null

Related issues

Resolves: TSA-150

Manual testing steps

  • yarn jest app/util/social/socialServiceTelemetry.test.ts
  • yarn jest on useTopTraders.test.ts, TopTradersView.test.tsx
  • Verify events in Sentry after release/internal build (not Metro dev — Logger.error no-ops in __DEV__)

Screenshots/Recordings

Before

After

Pre-merge author checklist

Performance checks (if applicable)

  • I've tested on Android
    • Ideally on a mid-range device; emulator is acceptable
  • I've tested with a power user scenario
    • Use these power-user SRPs to import wallets with many accounts and tokens
  • I've instrumented key operations with Sentry traces for production performance metrics

For performance guidelines and tooling, see the Performance Guide.

Pre-merge reviewer checklist

  • I've manually tested the PR (e.g. pull and build branch, run the app, test code being changed).
  • I confirm that this PR addresses all acceptance criteria described in the ticket it closes and includes the necessary testing evidence such as recordings and or screenshots.

Note

Low Risk
Changes are limited to error logging and test expectations; user flows and API behavior are unchanged aside from Quick Buy failures now going through Logger/Sentry instead of console.

Overview
Standardizes Social failures for Sentry with a shared feature:social tagging model in socialServiceTelemetry.ts, aligned with existing Perps-style Logger.error options.

Telemetry helpers: Adds buildSocialLoggerErrorOptions, reportSocialServiceFailure, useLogSocialQueryError, and formatSocialQueryErrorMessage; renames legacyMessageextraMessage in buildSocialErrorExtras; extends surfaces/endpoints (e.g. trader_profile, follow/unfollow, Quick Buy without a SocialService endpoint).

Call-site migration: Social react-query hooks (useTopTraders, useFollowedTraders, useTraderProfile, useTraderPositions, useTraderPosition) drop per-hook useEffect logging in favor of useLogSocialQueryError + structured refresh failures. Quick Buy replaces console.error with Logger.error on quote fetch and tx submit (chain tags). Top Traders pull-to-refresh and follow/unfollow use the same structured payload. Tests assert tags/extras instead of plain string second arguments.

Reviewed by Cursor Bugbot for commit d1fa812. Bugbot is set up for automated code reviews on this repo. Configure here.

@github-actions
Copy link
Copy Markdown
Contributor

CLA Signature Action: All authors have signed the CLA. You may need to manually re-run the blocking PR check if it doesn't pass in a few minutes.

@metamaskbotv2 metamaskbotv2 Bot added the team-social-ai Social & AI team label May 19, 2026
@github-actions github-actions Bot added size-L and removed size-M labels May 20, 2026
@Bigshmow Bigshmow marked this pull request as ready for review May 21, 2026 01:14
zone-live
zone-live previously approved these changes May 21, 2026
@github-actions github-actions Bot added size-XL and removed size-L labels May 24, 2026
@Bigshmow Bigshmow requested a review from zone-live May 24, 2026 22:54
@Bigshmow Bigshmow enabled auto-merge May 24, 2026 23:17
@github-actions
Copy link
Copy Markdown
Contributor

🔍 Smart E2E Test Selection

  • Selected E2E tags: SmokeWalletPlatform
  • Selected Performance tags: None (no tests recommended)
  • Risk Level: low
  • AI Confidence: 82%
click to see 🤖 AI reasoning details

E2E Test Selection:
All 20 changed files are Social Leaderboard feature files (hooks, telemetry utilities, and their unit tests). The changes are purely a telemetry/error-logging refactor: replacing scattered Logger.error + useEffect patterns with centralized helpers (reportSocialServiceFailure, useLogSocialQueryError, formatSocialQueryErrorMessage, buildSocialLoggerErrorOptions). No business logic, UI rendering, API calls, or data flows were changed. The Social Leaderboard (Top Traders, Trader Profile, Trader Position, Quick Buy, Followed Traders) is embedded in the Trending tab, which is tested under SmokeWalletPlatform. Since there are no dedicated E2E tests for Social Leaderboard and the changes are low-risk internal refactors, SmokeWalletPlatform is the most relevant tag to validate the Trending/Social surfaces still function correctly. No other tags are warranted as the changes don't touch confirmations, accounts, networks, swaps, snaps, or any other feature area.

Performance Test Selection:
The changes are purely telemetry/error-logging refactors with no impact on rendering performance, data loading, UI components, or critical user flows. No performance-sensitive code paths were modified.

View GitHub Actions results

@sonarqubecloud
Copy link
Copy Markdown

@Bigshmow Bigshmow added this pull request to the merge queue May 25, 2026
Merged via the queue into main with commit e259027 May 25, 2026
189 of 194 checks passed
@Bigshmow Bigshmow deleted the TSA-150-sentry-error-monitoring branch May 25, 2026 10:59
@github-actions github-actions Bot locked and limited conversation to collaborators May 25, 2026
@metamaskbotv2 metamaskbotv2 Bot added the release-7.80.0 Issue or pull request that will be included in release 7.80.0 label May 25, 2026
Sign up for free to subscribe to this conversation on GitHub. Already have an account? Sign in.

Labels

release-7.80.0 Issue or pull request that will be included in release 7.80.0 size-XL team-social-ai Social & AI team

Projects

None yet

Development

Successfully merging this pull request may close these issues.

2 participants