Skip to content

chore(tron): improve account sync observability - #374

Open
taran-a wants to merge 3 commits into
mainfrom
chore/improve-account-sync-observability
Open

taran-a wants to merge 3 commits into
mainfrom
chore/improve-account-sync-observability

Conversation

@taran-a

@taran-a taran-a commented Sep 25, 2026

Copy link
Copy Markdown
Contributor

Explanation

Improve observability of account synchronization failures in the Tron snap: per-account fetch failures were silently discarded (Promise.allSettled + flatMap dropped rejections), and adapter-level degradations were invisible — Sentry showed nothing actionable.

  • @metamask/snap-networks-utils: add SynchronizationError, formatAccountSyncFailures, and the AccountSyncFailure type. Failure details (account IDs + reasons) are embedded in the error message because snap_trackError only serializes name, message, stack, and cause.
  • AccountsService: report per-account fetch failures in one SynchronizationError per sync run (each failure attributed to its account via the settled-results order); track batch save failures standalone (Failed to save assets / Failed to save transactions, with the original error as cause). Reporting is defensive — a failure while reporting is logged and swallowed, never breaking the sync flow.
  • SnapAssetsAdapter: make previously silent degradations visible — unexpected account-info failures currently treated as "inactive account" (a transient 500/timeout zeroes balances), TRC20-fallback failures, and spot-price failures — each tracked with a context message and the original error as cause. No behavior changes.

All new failures with proper description.

Screenshot 2026-09-25 at 16 21 33

Account sync with 5 accounts id and reasons

Screenshot 2026-09-25 at 16 23 55

References

Checklist

  • I've updated the test suite for new or updated code as appropriate
  • I've updated documentation (JSDoc, Markdown, etc.) for new or updated code as appropriate
  • I've communicated my changes to consumers by updating changelogs for packages I've changed
  • I've introduced breaking changes in this PR and have prepared draft pull requests for clients and consumer packages to resolve them

@taran-a
taran-a requested a review from a team as a code owner September 25, 2026 14:29
@taran-a
taran-a deployed to default-branch September 25, 2026 14:29 — with GitHub Actions Active
@taran-a
taran-a force-pushed the chore/improve-account-sync-observability branch from 0208cb5 to 97a110f Compare September 25, 2026 14:29
@taran-a
taran-a force-pushed the chore/improve-account-sync-observability branch from 97a110f to 8fbb52d Compare September 25, 2026 16:29
@taran-a
taran-a force-pushed the chore/improve-account-sync-observability branch from 8fbb52d to 8fbd885 Compare September 25, 2026 16:31
@sonarqubecloud

Copy link
Copy Markdown

This branch was successfully deployed

1 active (outdated) deployment
default-branch — 0208cb52 Deployed Sep 25, 2026 by taran-a via Determine whether this PR is a release PR #1307
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Projects

None yet

Development

Successfully merging this pull request may close these issues.

1 participant