chore: add unknown to feature ids#9071
Merged
Merged
Conversation
micaelae
approved these changes
Jun 9, 2026
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 join this conversation on GitHub.
Already have an account?
Sign in to comment
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.
Explanation
FeatureIdin@metamask/bridge-controllerenumerates 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 (typicallyUNIFIED_SWAP_BRIDGE) or omitfeatureIdentirely 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 otherFeatureIdmembers. Callers can now passFeatureId.UNKNOWNexplicitly tofetchQuotes, 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_BRIDGEwhenfeatureIdis absent) are unchanged. This is an additive, non-breaking export.References
FeatureIdand requiredfeature_idon analytics events)Checklist
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-controllerso clients can tag quote fetches and Unified Swap/Bridge analytics when the originating UI/feature cannot be identified, instead of reusing anotherFeatureIdor omitting the field.This is an additive, non-breaking type export only; controller defaults and metrics behavior when
featureIdis 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.