Skip to content

feat(STX-472): add gas-included metrics properties#28571

Open
rarquevaux wants to merge 1 commit intomainfrom
feat/STX-472
Open

feat(STX-472): add gas-included metrics properties#28571
rarquevaux wants to merge 1 commit intomainfrom
feat/STX-472

Conversation

@rarquevaux
Copy link
Copy Markdown
Contributor

@rarquevaux rarquevaux commented Apr 8, 2026

Description

Same changes than MetaMask/metamask-extension#41581

Changelog

CHANGELOG entry: add gas-included metrics properties

Related issues

Fixes:

Manual testing steps

Feature: my feature name

  Scenario: user [verb for user action]
    Given [describe expected initial app state]

    When user [verb for user action]
    Then [describe expected outcome]

Screenshots/Recordings

Before

After

Pre-merge author checklist

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
Low risk: adds a confirmation metrics side-effect alongside existing auto-selection logic and updates unit tests accordingly, with minimal impact on transaction behavior.

Overview
Adds confirmation metrics when useAutomaticGasFeeTokenSelect automatically picks a gas fee token. When auto-selection triggers, it now calls setConfirmationMetric with automatic_fee_token_selection: true and the selected token symbol, and expands the effect dependencies accordingly.

Updates useAutomaticGasFeeTokenSelect.test.ts to mock useConfirmationMetricEvents and assert metrics are emitted only when an automatic selection occurs (and not on other paths or rerenders).

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

@rarquevaux rarquevaux requested a review from a team as a code owner April 8, 2026 21:04
@github-actions
Copy link
Copy Markdown
Contributor

github-actions bot commented Apr 8, 2026

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.

@metamaskbot metamaskbot added the team-transactions Transactions team label Apr 8, 2026
@github-actions github-actions bot added the risk-low Low testing needed · Low bug introduction risk label Apr 8, 2026
@github-actions
Copy link
Copy Markdown
Contributor

github-actions bot commented Apr 8, 2026

🔍 Smart E2E Test Selection

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

E2E Test Selection:
The changes are confined to useAutomaticGasFeeTokenSelect.ts and its test file. The modification adds analytics metric tracking (via useConfirmationMetricEvents) when an automatic gas fee token is selected during the EIP-7702 gasless transaction flow. The core selection logic is unchanged — only a setConfirmationMetric call is added to record automatic_fee_token_selection and automatic_fee_token_selected properties when shouldSelect is true.

This hook is used in gas-fee-details-row.tsx within the confirmations component tree, specifically for the EIP-7702 advanced account abstraction feature (gas fee token payments). SmokeConfirmations covers 'advanced EIP-7702 account abstraction features like batch transactions and gas fee token payments', making it the directly relevant tag.

No other areas are impacted: no navigation changes, no controller changes, no shared components affected. The test file changes are unit test updates to verify the new analytics assertions. Risk is low since the functional behavior is unchanged.

Performance Test Selection:
The changes only add analytics metric tracking to an existing hook. No UI rendering changes, no data loading changes, no state management changes that would affect performance. The added setConfirmationMetric call is a lightweight analytics event and would not measurably impact performance.

View GitHub Actions results

@github-actions github-actions bot added the size-S label Apr 8, 2026
@sonarqubecloud
Copy link
Copy Markdown

sonarqubecloud bot commented Apr 8, 2026

@github-actions
Copy link
Copy Markdown
Contributor

github-actions bot commented Apr 8, 2026

E2E Fixture Validation — Schema is up to date
17 value mismatches detected (expected — fixture represents an existing user).
View details

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

risk-low Low testing needed · Low bug introduction risk size-S team-transactions Transactions team

Projects

None yet

Development

Successfully merging this pull request may close these issues.

2 participants