Commit 6886442
authored
fix(geolocation-controller): point to API Platform geolocation-api instead of legacy Ramps endpoint (#9417)
## Explanation
`GeolocationApiService` (used by Ramp, Perps, Rewards, Card, mUSD, and
Money Account across extension and mobile) still fetches from the legacy
Ramps-owned `on-ramp.{env}api.cx.metamask.io/geolocation` endpoint.
That endpoint is slated for deprecation now that geolocation is a
platform-owned service. 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.io` does
not resolve, and the UAT workload config in
`va-mmcx-geolocation-api-workload` is empty). This PR temporarily maps
`Env.UAT` to 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:
- the PROD/DEV URLs are correct and stable
- the UAT-points-at-PROD interim approach is acceptable on their end
## References
- `packages/geolocation-controller` is owned by
`@metamask-mobile-platform` per CODEOWNERS
- API Platform docs: https://docs.cx.metamask.io/api/geolocation/
Supersedes #9415 (opened from a fork by mistake, which broke the
changelog-diff CI check).
<!-- CURSOR_SUMMARY -->
---
> [!NOTE]
> **Medium Risk**
> Wide downstream use (Ramp, Perps, Rewards, etc.) makes any geolocation
outage impactful, though the API contract is unchanged; UAT hitting
production is an interim operational caveat.
>
> **Overview**
> **`GeolocationApiService`** now calls API Platform’s
**`geolocation-api`** host and **`/v1/geolocation`** path instead of the
legacy Ramps **`on-ramp.*`** **`/geolocation`** URLs that are being
deprecated. The response contract is unchanged (plain-text ISO 3166-2).
>
> **`getGeolocationUrl`** builds
**`https://geolocation.api.cx.metamask.io`** for production and UAT, and
**`https://geolocation.dev-api.cx.metamask.io`** for DEV. **UAT** no
longer uses a separate **`uat-`** host and temporarily shares the
production URL until API Platform provisions a UAT deployment. Tests and
the changelog reflect the new URLs and UAT behavior.
>
> <sup>Reviewed by [Cursor Bugbot](https://cursor.com/bugbot) for commit
411259b. Bugbot is set up for automated
code reviews on this repo. Configure
[here](https://www.cursor.com/dashboard/bugbot).</sup>
<!-- /CURSOR_SUMMARY -->1 parent c881134 commit 6886442
3 files changed
Lines changed: 14 additions & 7 deletions
File tree
- packages/geolocation-controller
- src/geolocation-api-service
| Original file line number | Diff line number | Diff line change | |
|---|---|---|---|
| |||
9 | 9 | | |
10 | 10 | | |
11 | 11 | | |
| 12 | + | |
| 13 | + | |
12 | 14 | | |
13 | 15 | | |
14 | 16 | | |
| |||
Lines changed: 4 additions & 4 deletions
| Original file line number | Diff line number | Diff line change | |
|---|---|---|---|
| |||
44 | 44 | | |
45 | 45 | | |
46 | 46 | | |
47 | | - | |
| 47 | + | |
48 | 48 | | |
49 | 49 | | |
50 | 50 | | |
51 | | - | |
| 51 | + | |
52 | 52 | | |
53 | 53 | | |
54 | 54 | | |
| |||
57 | 57 | | |
58 | 58 | | |
59 | 59 | | |
60 | | - | |
| 60 | + | |
61 | 61 | | |
62 | 62 | | |
63 | 63 | | |
| |||
70 | 70 | | |
71 | 71 | | |
72 | 72 | | |
73 | | - | |
| 73 | + | |
74 | 74 | | |
75 | 75 | | |
76 | 76 | | |
| |||
Lines changed: 8 additions & 3 deletions
| Original file line number | Diff line number | Diff line change | |
|---|---|---|---|
| |||
11 | 11 | | |
12 | 12 | | |
13 | 13 | | |
14 | | - | |
| 14 | + | |
15 | 15 | | |
16 | 16 | | |
17 | 17 | | |
| |||
68 | 68 | | |
69 | 69 | | |
70 | 70 | | |
| 71 | + | |
| 72 | + | |
| 73 | + | |
| 74 | + | |
| 75 | + | |
71 | 76 | | |
72 | 77 | | |
73 | 78 | | |
74 | 79 | | |
75 | | - | |
76 | | - | |
| 80 | + | |
| 81 | + | |
77 | 82 | | |
78 | 83 | | |
79 | 84 | | |
| |||
0 commit comments