Commit 67b2d42
committed
feat(analytics): align Remote Connection Request platform property with sig/txn events
Pairs with [segment-schema#545](Consensys/segment-schema#545),
which renames `sdk_platform` → `remote_request_platform` on the Remote
Connection Request Received/Failed events and tightens the type to the
5-value `PlatformType` enum shared between SDK v1 and v2.
Mobile-side changes:
- `SDKConnectV2/services/connection-registry.ts`: rename the property
key on the three MWP `trackMwpEvent` call sites (the V2 emitter).
- `SDKConnect/ConnectionManagement/connectToChannel.ts`: extend the V1
emitter to populate `remote_request_platform` from
`originatorInfo.platform`. V1 previously did not populate this field
at all. The value is coerced from an empty string to `undefined` so
the property is dropped when `getPlatformType` can't resolve a
platform (the remote SDK falls back to `platform: ''` in that case),
avoiding an invalid-enum rejection on the Segment side.
- Updated tests to assert the new key and the empty-string coercion.
Both V1 and V2 derive their platform values from `PlatformType` in
`@metamask/sdk-communication-layer`, so no client-side mapping or enum
widening is required.1 parent 70f8823 commit 67b2d42
4 files changed
Lines changed: 34 additions & 4 deletions
File tree
- app/core
- SDKConnectV2/services
- SDKConnect/ConnectionManagement
Lines changed: 23 additions & 0 deletions
| Original file line number | Diff line number | Diff line change | |
|---|---|---|---|
| |||
282 | 282 | | |
283 | 283 | | |
284 | 284 | | |
| 285 | + | |
| 286 | + | |
285 | 287 | | |
286 | 288 | | |
287 | 289 | | |
288 | 290 | | |
289 | 291 | | |
| 292 | + | |
| 293 | + | |
| 294 | + | |
| 295 | + | |
| 296 | + | |
| 297 | + | |
| 298 | + | |
| 299 | + | |
| 300 | + | |
| 301 | + | |
| 302 | + | |
| 303 | + | |
| 304 | + | |
| 305 | + | |
| 306 | + | |
| 307 | + | |
| 308 | + | |
| 309 | + | |
| 310 | + | |
| 311 | + | |
| 312 | + | |
290 | 313 | | |
291 | 314 | | |
292 | 315 | | |
| |||
Lines changed: 7 additions & 0 deletions
| Original file line number | Diff line number | Diff line change | |
|---|---|---|---|
| |||
85 | 85 | | |
86 | 86 | | |
87 | 87 | | |
| 88 | + | |
| 89 | + | |
| 90 | + | |
| 91 | + | |
| 92 | + | |
| 93 | + | |
| 94 | + | |
88 | 95 | | |
89 | 96 | | |
90 | 97 | | |
| |||
| Original file line number | Diff line number | Diff line change | |
|---|---|---|---|
| |||
441 | 441 | | |
442 | 442 | | |
443 | 443 | | |
444 | | - | |
| 444 | + | |
445 | 445 | | |
446 | 446 | | |
447 | 447 | | |
| |||
| Original file line number | Diff line number | Diff line change | |
|---|---|---|---|
| |||
182 | 182 | | |
183 | 183 | | |
184 | 184 | | |
185 | | - | |
| 185 | + | |
186 | 186 | | |
187 | 187 | | |
188 | 188 | | |
| |||
257 | 257 | | |
258 | 258 | | |
259 | 259 | | |
260 | | - | |
| 260 | + | |
261 | 261 | | |
262 | 262 | | |
263 | 263 | | |
| |||
304 | 304 | | |
305 | 305 | | |
306 | 306 | | |
307 | | - | |
| 307 | + | |
308 | 308 | | |
309 | 309 | | |
310 | 310 | | |
| |||
0 commit comments