fix(geolocation-controller): point to API Platform geolocation-api instead of legacy Ramps endpoint#9415
Closed
amitabh94 wants to merge 2 commits into
Conversation
…stead of legacy Ramps on-ramp endpoint
GeolocationApiService still called the Ramps-owned
on-ramp.{env}api.cx.metamask.io/geolocation endpoint, which is slated for
deprecation now that geolocation is a platform-owned service. Repoint at
geolocation.{env}api.cx.metamask.io/v1/geolocation instead. Same response
contract (plain-text ISO 3166-2 code), so no consumer-facing changes needed.
UAT temporarily resolves to the production URL since API Platform has not
yet provisioned a dedicated UAT deployment for this service.
Contributor
Author
|
Closing in favor of #9417 — opened the branch directly on MetaMask/core instead of from a fork, since that's what broke the changelog-diff CI check here. |
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
GeolocationApiService(used by Ramp, Perps, Rewards, Card, mUSD, and Money Account across extension and mobile) still fetches from the legacy Ramps-ownedon-ramp.{env}api.cx.metamask.io/geolocationendpoint.That endpoint is slated for deprecation now that geolocation is a platform-owned concern — see internal Slack context. API Platform's replacement,
geolocation.{env}api.cx.metamask.io/v1/geolocation, has been live since March and returns the same plain-text ISO 3166-2 response format, so this is a same-contract URL swap with no consumer-facing changes.Open item before merge
API Platform has not yet provisioned a dedicated UAT deployment for
geolocation-api(confirmed:geolocation.uat-api.cx.metamask.iodoes not resolve, and the UAT workload config inva-mmcx-geolocation-api-workloadis empty). This PR temporarily mapsEnv.UATto the production URL so UAT testing isn't broken by this change. That mapping should be revisited once a real UAT deployment exists.Opening as draft pending confirmation from API Platform (
@api-platform-devs) that:References
packages/geolocation-controlleris owned by@metamask-mobile-platformper CODEOWNERSNote
Medium Risk
Geolocation is shared across multiple products (Ramp, Perps, Rewards, etc.); a wrong host or UAT→prod mapping could affect regional behavior, though the response contract is intended to stay the same.
Overview
GeolocationApiServicenow calls API Platform’sgeolocation-apiinstead of the legacy Rampson-rampgeolocation host, ahead of that endpoint’s deprecation. The path changes from/geolocationto/v1/geolocation, and hosts move fromon-ramp.{env}api.cx.metamask.iotogeolocation.{env}api.cx.metamask.io(DEV still uses thedev-prefix). Response handling and caching are unchanged.UAT no longer uses a separate UAT URL because API Platform has not deployed
geolocation-apithere yet;Env.UATtemporarily uses the production geolocation URL. Tests and the changelog document that interim mapping.Reviewed by Cursor Bugbot for commit 73d9472. Bugbot is set up for automated code reviews on this repo. Configure here.