Skip to content

chore: add unknown to feature ids#9071

Merged
infiniteflower merged 2 commits into
mainfrom
chore/bridge-unknown-featureid
Jun 9, 2026
Merged

chore: add unknown to feature ids#9071
infiniteflower merged 2 commits into
mainfrom
chore/bridge-unknown-featureid

Conversation

@infiniteflower

@infiniteflower infiniteflower commented Jun 9, 2026

Copy link
Copy Markdown
Contributor

Explanation

FeatureId in @metamask/bridge-controller enumerates the client experiences that request quotes and emit Unified Swap/Bridge analytics (e.g. perps, unified_swap_bridge, dapp_swap). There was no explicit value for cases where the originating feature cannot be determined, so callers had to reuse an existing ID (typically UNIFIED_SWAP_BRIDGE) or omit featureId entirely and rely on controller fallbacks.

This PR adds FeatureId.UNKNOWN = 'unknown' to the enum. The string value follows the existing snake_case segment convention used by other FeatureId members. Callers can now pass FeatureId.UNKNOWN explicitly to fetchQuotes, quote requests, and analytics events when the feature context is unavailable.

No controller behavior changes are included. Sorting, quote-request overrides, and metrics fallbacks (which still default to UNIFIED_SWAP_BRIDGE when featureId is absent) are unchanged. This is an additive, non-breaking export.

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

Note

Low Risk
Enum-only additive export with no runtime or controller logic changes; low risk aside from consumers optionally adopting the new analytics value.

Overview
Adds FeatureId.UNKNOWN ('unknown') to @metamask/bridge-controller so clients can tag quote fetches and Unified Swap/Bridge analytics when the originating UI/feature cannot be identified, instead of reusing another FeatureId or omitting the field.

This is an additive, non-breaking type export only; controller defaults and metrics behavior when featureId is missing are unchanged. The Unreleased changelog entry documents the new enum member.

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

@infiniteflower infiniteflower marked this pull request as ready for review June 9, 2026 21:35
@infiniteflower infiniteflower requested review from a team as code owners June 9, 2026 21:35
@infiniteflower infiniteflower enabled auto-merge June 9, 2026 21:37
@infiniteflower infiniteflower added this pull request to the merge queue Jun 9, 2026
Merged via the queue into main with commit 63f66cf Jun 9, 2026
370 checks passed
@infiniteflower infiniteflower deleted the chore/bridge-unknown-featureid branch June 9, 2026 22:09
@cursor cursor Bot mentioned this pull request Jun 9, 2026
4 tasks
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

2 participants