feat(rewards): add points estimate history for CS diagnostics#39641
Merged
feat(rewards): add points estimate history for CS diagnostics#39641
Conversation
Store the last 20 successful points estimates in state logs to help Customer Support verify user-reported discrepancies between estimated and awarded points. Changes: - Add PointsEstimateHistoryEntry type for history entries - Add rewardsPointsEstimateHistory to RewardsControllerState - Track successful estimatePoints calls with timestamp, activity type, account, points estimate, and bonus bips - Maintain bounded history (max 20 entries, most recent first) - Include in state logs for CS access (includeInStateLogs: true) Resolves: RWDS-926 Co-Authored-By: Claude Opus 4.5 <noreply@anthropic.com>
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. |
Contributor
Builds ready [ce2f90e]
UI Startup Metrics (1351 ± 102 ms)
📊 Page Load Benchmark ResultsCurrent Commit: 📄 Localhost MetaMask Test DappSamples: 100 Summary
📈 Detailed Results
Bundle size diffs [🚨 Warning! Bundle size has increased!]
|
…response Changed PointsEstimateHistoryEntry to store the full request and response objects instead of extracting individual fields. This preserves more context (including activityContext) for Customer Support diagnostics. Co-Authored-By: Claude Opus 4.5 <noreply@anthropic.com>
More history entries provide better diagnostic data for Customer Support when investigating user-reported discrepancies. Co-Authored-By: Claude Opus 4.5 <noreply@anthropic.com>
Contributor
Builds ready [861b2b1]
UI Startup Metrics (1332 ± 109 ms)
📊 Page Load Benchmark ResultsCurrent Commit: 📄 Localhost MetaMask Test DappSamples: 100 Summary
📈 Detailed Results
Bundle size diffs [🚨 Warning! Bundle size has increased!]
|
Replace nested EstimateAssetDto objects with individual primitive fields for swap source, destination, and fee assets. Each asset is now stored as separate ID, amount, and USD price fields for easier diagnostics and serialization. Changes: - requestSwapSrcAsset → requestSwapSrcAssetId/Amount/UsdPrice - requestSwapDestAsset → requestSwapDestAssetId/Amount/UsdPrice - requestSwapFeeAsset → requestSwapFeeAssetId/Amount/UsdPrice Co-Authored-By: Claude Opus 4.5 <noreply@anthropic.com>
Add the new rewardsPointsEstimateHistory field to: - Sentry state configuration (excluded from debug snapshots) - E2E onboarding fixture - Error state snapshot fixtures Co-Authored-By: Claude Opus 4.5 <noreply@anthropic.com>
Contributor
✨ Files requiring CODEOWNER review ✨👨🔧 @MetaMask/extension-platform (1 files, +2 -1)
🕵️ @MetaMask/extension-privacy-reviewers (1 files, +1 -0)
🧪 @MetaMask/qa (2 files, +3 -1)
|
Contributor
Builds ready [06efbad]
UI Startup Metrics (1323 ± 131 ms)
📊 Page Load Benchmark ResultsCurrent Commit: 📄 Localhost MetaMask Test DappSamples: 100 Summary
📈 Detailed Results
Bundle size diffs [🚨 Warning! Bundle size has increased!]
|
Contributor
Builds ready [7b77793]
UI Startup Metrics (1313 ± 126 ms)
📊 Page Load Benchmark ResultsCurrent Commit: 📄 Localhost MetaMask Test DappSamples: 100 Summary
📈 Detailed Results
Bundle size diffs [🚨 Warning! Bundle size has increased!]
|
Contributor
Builds ready [ef76f07]
UI Startup Metrics (1330 ± 105 ms)
📊 Page Load Benchmark ResultsCurrent Commit: 📄 Localhost MetaMask Test DappSamples: 100 Summary
📈 Detailed Results
Bundle size diffs [🚨 Warning! Bundle size has increased!]
|
jbblanc
approved these changes
Feb 2, 2026
github-merge-queue bot
pushed a commit
that referenced
this pull request
Feb 3, 2026
## **Description** Store the last 50 successful points estimates in state logs to help Customer Support verify user-reported discrepancies between estimated and awarded points. ## **Changelog** CHANGELOG entry: Added points estimate history tracking to state logs for Customer Support diagnostics <!-- CURSOR_SUMMARY --> --- > [!NOTE] > **Medium Risk** > Persists and logs additional rewards-related request/response data (including account and activity details), which increases stored state/log surface area and could affect privacy/perf if misused. Functional risk is contained by bounding history to 50 entries and isolating history-write failures from `estimatePoints()` results. > > **Overview** > Adds `rewardsPointsEstimateHistory` to `RewardsController` state and defaults, persisting it and including it in state logs for Customer Support diagnostics. > > `estimatePoints()` now records each successful estimate (flattened request context for swap/perps/shield plus response and timestamp) via `addPointsEstimateToHistory`, keeps most-recent-first, and caps history at 50 entries while swallowing/logging history-update errors. > > Wires the new state field through background state typing and test fixtures/state snapshots, and explicitly excludes it from Sentry background state attachment. > > <sup>Written by [Cursor Bugbot](https://cursor.com/dashboard?tab=bugbot) for commit ef76f07. This will update automatically on new commits. Configure [here](https://cursor.com/dashboard?tab=bugbot).</sup> <!-- /CURSOR_SUMMARY --> --------- Co-authored-by: Claude Opus 4.5 <noreply@anthropic.com>
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Sign up for free
to subscribe to this conversation on GitHub.
Already have an account?
Sign in.
Add this suggestion to a batch that can be applied as a single commit.This suggestion is invalid because no changes were made to the code.Suggestions cannot be applied while the pull request is closed.Suggestions cannot be applied while viewing a subset of changes.Only one suggestion per line can be applied in a batch.Add this suggestion to a batch that can be applied as a single commit.Applying suggestions on deleted lines is not supported.You must change the existing code in this line in order to create a valid suggestion.Outdated suggestions cannot be applied.This suggestion has been applied or marked resolved.Suggestions cannot be applied from pending reviews.Suggestions cannot be applied on multi-line comments.Suggestions cannot be applied while the pull request is queued to merge.Suggestion cannot be applied right now. Please check back later.
Description
Store the last 50 successful points estimates in state logs to help Customer Support verify user-reported discrepancies between estimated and awarded points.
Changelog
CHANGELOG entry: Added points estimate history tracking to state logs for Customer Support diagnostics
Note
Medium Risk
Persists and logs additional rewards-related request/response data (including account and activity details), which increases stored state/log surface area and could affect privacy/perf if misused. Functional risk is contained by bounding history to 50 entries and isolating history-write failures from
estimatePoints()results.Overview
Adds
rewardsPointsEstimateHistorytoRewardsControllerstate and defaults, persisting it and including it in state logs for Customer Support diagnostics.estimatePoints()now records each successful estimate (flattened request context for swap/perps/shield plus response and timestamp) viaaddPointsEstimateToHistory, keeps most-recent-first, and caps history at 50 entries while swallowing/logging history-update errors.Wires the new state field through background state typing and test fixtures/state snapshots, and explicitly excludes it from Sentry background state attachment.
Written by Cursor Bugbot for commit ef76f07. This will update automatically on new commits. Configure here.