Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

feat(1840): Use "decimal" format instead of "hexadecimal" format for "chain_id" event property #30703

Closed
wants to merge 1 commit into from

Conversation

DDDDDanica
Copy link
Contributor

@DDDDDanica DDDDDanica commented Mar 3, 2025

Description

Migrated from original PR due to conflict
#24203.

This PR standardizes the chain_id event property in metrics tracking by converting hexadecimal chain IDs to decimal format. This ensures consistent data representation across our analytics platform while maintaining compatibility with all existing chain ID formats.

Context:
The extension codebase currently uses multiple chain ID formats:

  • Hexadecimal (e.g., "0x1" for Ethereum Mainnet)
  • Decimal (e.g., "1")
  • CAIP chain IDs (following the format "namespace:reference", e.g., "eip155:1")

Rather than modifying each individual event tracking call, this approach centralizes the format standardization logic, making our codebase more maintainable and our metrics more consistent.

Open in GitHub Codespaces

Related issues

Fixes: https://github.com/MetaMask/MetaMask-planning/issues/1840

Manual testing steps

  1. Go to this page...

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.

@DDDDDanica DDDDDanica self-assigned this Mar 3, 2025
Copy link
Contributor

github-actions bot commented Mar 3, 2025

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-extension-platform Extension Platform team label Mar 3, 2025
@DDDDDanica DDDDDanica force-pushed the feature/1840/chainid branch 6 times, most recently from 0058645 to 4c3a623 Compare March 4, 2025 16:57
@DDDDDanica DDDDDanica force-pushed the feature/1840/chainid branch from 4c3a623 to 31348a5 Compare March 4, 2025 17:39
@DDDDDanica
Copy link
Contributor Author

The data team doesn't want us to convert chainId in segment to decimal. But it sounds like they will want us to send an extra field for non-ethereum chains in the future (chain_id_caip).

=> Close until requirement to be defined

@DDDDDanica DDDDDanica closed this Mar 5, 2025
@github-actions github-actions bot locked and limited conversation to collaborators Mar 5, 2025
@DDDDDanica DDDDDanica deleted the feature/1840/chainid branch March 5, 2025 12:34
Sign up for free to subscribe to this conversation on GitHub. Already have an account? Sign in.
Labels
team-extension-platform Extension Platform team
Projects
None yet
Development

Successfully merging this pull request may close these issues.

2 participants