feat: sync V2 ramps orders with Backup & Sync - #33148
Conversation
|
CLA Signature Action: All authors have signed the CLA. You may need to manually re-run the blocking PR check if it doesn't pass in a few minutes. |
Wire RampsController order syncing into mobile: messenger delegation, Backup & Sync sub-toggle, identity-effect pull on unlock, and fixtures for isRampsSyncingEnabled. Depends on MetaMask/core#9474. Co-authored-by: Cursor <cursoragent@cursor.com>
Align selectIsRampsSyncingEnabled with UserStorageController default state so the Backup & Sync toggle and background sync gates stay consistent for upgraded profiles that omit isRampsSyncingEnabled. Co-authored-by: Cursor <cursoragent@cursor.com>
@metamask/ramps-controller no longer exports normalizeProviderCode; use raw provider IDs from quotes and orders so V2 ramp flows compile against core order-syncing packages. Co-authored-by: Cursor <cursoragent@cursor.com>
b129eca to
e8da86c
Compare
🧪 Flaky unit test detectionRun history flaky detectionHistorical failure rate is a hint, not proof — review each suggestion in context. See the flaky-test-detection skill for the full pattern reference and manual audit workflow. Failures / runs sampled per window:
AI-detected flaky patterns
|
Use RAMPS_CONTROLLER_REQUIRED_SERVICE_ACTIONS for messenger wiring so mobile stays aligned with extension and core when required actions change. Co-authored-by: Cursor <cursoragent@cursor.com>
Treat placeholder tx hashes as missing so Activity falls back to the order id for row identity, and normalize string createdAt for sorting. Co-authored-by: Cursor <cursoragent@cursor.com>
Keep RAMPS_CONTROLLER_REQUIRED_SERVICE_ACTIONS plus User Storage / auth delegation for order sync, and add RemoteFeatureFlagController getState for moneyHeadlessAllProviders quote widening from main. Co-authored-by: Cursor <cursoragent@cursor.com>
Expectations were updated to /providers/... while the hook still passes selectedProvider.id (e.g. transak-native-staging). Co-authored-by: Cursor <cursoragent@cursor.com>
Point at @metamask-previews ramps/profile-sync packages from core#9474 and align the ramps messenger with the required User Storage actions. Co-authored-by: Cursor <cursoragent@cursor.com>
Clear incompatible persisted auth when switching DEV/PRD Profile Sync backends so ramps order sync can mint a fresh session, and point previewBuilds at the latest core ramps-controller preview for QA. Co-authored-by: Cursor <cursoragent@cursor.com>
Resolve package.json conflict while keeping core preview pins, and drop JWT-based Profile Sync auth sanitization that was only needed for local DEV/PRD env switching. Co-authored-by: Cursor <cursoragent@cursor.com>
Drop the unused listEntropySources delegation and keep canonical provider codes for order polling / deeplink redirects. Co-authored-by: Cursor <cursoragent@cursor.com>
Resolve conflicts against main: - ramps-controller-messenger: keep User Storage + auth action delegation for order sync; required service actions are already spread once (drop main's duplicate spread). - ramp-order-helpers: keep main's caipChainIdFromAssetId and isPlausibleRampTxHash naming, and fold in this PR's DUMMY_TX_ID / null / undefined placeholder rejects. - package.json: take app version 8.8.0 and assets-controller resolutions from main; keep core previewBuilds / preview resolutions for unpublished order-sync packages. - Accept main's Detox→Appium migration of incoming-transactions smoke, and port isRampsSyncingEnabled:false into the Appium fixture so Backup & Sync stays disabled there. Co-authored-by: Cursor <cursoragent@cursor.com>
|
Review the following changes in direct dependencies. Learn more about Socket for GitHub.
|
|
All alerts resolved. Learn more about Socket for GitHub. This PR previously contained dependency changes with security issues that have been resolved, removed, or ignored. Ignoring alerts on:
|
Re-pin ramps-controller and profile-sync-controller to the #9474 preview, add RampsController order-sync error/trace callbacks, and cover the Buy & sell orders settings toggle in view/Appium helpers. Co-authored-by: Cursor <cursoragent@cursor.com>
|
| Platform | Device | Reason | Recording |
|---|---|---|---|
| Android | Google Pixel 8 Pro (v14.0) | Quality gates exceeded | 📹 Watch |
🔬 App profiling check · Current run 31520857793 · Baseline (last run on main (scenario also failing)) run 30897750395 @ 67486d2
⚠️ No green baseline onmain— comparing against the latest usable profiling.
Summary:
ℹ️ API calls unavailable:
Network logs API error: Bad Request
Full metric table (+10% variance rules)
Disclaimer — allowed variance: a +10% margin over the baseline is permitted.
- If
Current <= Baseline + 10%, treated as acceptable noise.- If
Current > Baseline + 10%, Current and variance % are highlighted with⚠️ .
| Metric | Baseline | Current | Δ |
|---|---|---|---|
| CPU avg | 5.95% | 10.46% | +4.51 (+75.8%) |
| CPU max | 19.17% | 21.85% | +2.68 (+14%) |
| Memory avg | 586.2 MB | 613.03 MB | +26.83 (+4.6%) |
| Memory max | 722.61 MB | 839.17 MB | +116.56 (+16.1%) |
| Slow frames | 2.51% | 6.82% | +4.31 (+171.7%) |
| Frozen frames | 0% | 0% | 0 (0%) |
| ANRs | 0 | 0 | 0 (0%) |
| Issues | 2 | 2 | 0 (0%) |
| Critical issues | 1 | 2 | +1 (+100%) |
| App size | 328.67 MB | 329.01 MB | +0.34 (+0.1%) |
Account creation after fresh install
| Platform | Device | Reason | Recording |
|---|---|---|---|
| Android | Google Pixel 8 Pro (v14.0) | Quality gates exceeded | 📹 Watch |
🔬 App profiling check · Current run 31520857793 · Baseline (last run on main (scenario also failing)) run 30897750395 @ 67486d2
⚠️ No green baseline onmain— comparing against the latest usable profiling.
Summary:
ℹ️ API calls unavailable:
Network logs API error: Bad Request
Full metric table (+10% variance rules)
Disclaimer — allowed variance: a +10% margin over the baseline is permitted.
- If
Current <= Baseline + 10%, treated as acceptable noise.- If
Current > Baseline + 10%, Current and variance % are highlighted with⚠️ .
| Metric | Baseline | Current | Δ |
|---|---|---|---|
| CPU avg | 13.86% | 6.25% | -7.61 (-54.9%) |
| CPU max | 19.43% | 23.26% | +3.83 (+19.7%) |
| Memory avg | 490.61 MB | 767.07 MB | +276.46 (+56.4%) |
| Memory max | 568.32 MB | 881.42 MB | +313.1 (+55.1%) |
| Slow frames | 3.1% | 9.28% | +6.18 (+199.4%) |
| Frozen frames | 0% | 0% | 0 (0%) |
| ANRs | 0 | 0 | 0 (0%) |
| Issues | 1 | 2 | +1 (+100%) |
| Critical issues | 1 | 2 | +1 (+100%) |
| App size | 328.67 MB | 329.01 MB | +0.34 (+0.1%) |
Seedless Onboarding: Apple Login New User
| Platform | Device | Reason | Recording |
|---|---|---|---|
| Android | Google Pixel 8 Pro (v14.0) | Quality gates exceeded | 📹 Watch |
🔬 App profiling check · Current run 31520857793 · Baseline (last run on main (scenario also failing)) run 30897750395 @ 67486d2
⚠️ No green baseline onmain— comparing against the latest usable profiling.
Summary:
ℹ️ API calls unavailable:
Network logs API error: Bad Request
Full metric table (+10% variance rules)
Disclaimer — allowed variance: a +10% margin over the baseline is permitted.
- If
Current <= Baseline + 10%, treated as acceptable noise.- If
Current > Baseline + 10%, Current and variance % are highlighted with⚠️ .
| Metric | Baseline | Current | Δ |
|---|---|---|---|
| CPU avg | 13.93% | 6.08% | -7.85 (-56.3%) |
| CPU max | 18.74% | 24.89% | +6.15 (+32.8%) |
| Memory avg | 540.28 MB | 593.86 MB | +53.58 (+9.9%) |
| Memory max | 604.4 MB | 888.96 MB | +284.56 (+47.1%) |
| Slow frames | 3.05% | 14.75% | +11.7 (+383.6%) |
| Frozen frames | 0% | 0% | 0 (0%) |
| ANRs | 0 | 0 | 0 (0%) |
| Issues | 1 | 2 | +1 (+100%) |
| Critical issues | 1 | 2 | +1 (+100%) |
| App size | 328.67 MB | 329.01 MB | +0.34 (+0.1%) |
Seedless Onboarding: Telegram Login New User
| Platform | Device | Reason | Recording |
|---|---|---|---|
| Android | Google Pixel 8 Pro (v14.0) | Timed out | — |
✅ Passed Tests (4)
| Test | Platform | Device | Duration | Team | Recording |
|---|---|---|---|---|---|
| Measure Cold Start To Onboarding Screen | Android | Google Pixel 8 Pro (v14.0) | 3.63s | @metamask-mobile-platform | 📹 Watch |
| Onboarding Import SRP with +50 accounts, SRP 3 | Android | Google Pixel 8 Pro (v14.0) | 7.50s | @metamask-onboarding-team | 📹 Watch |
| Perps open position and close it | Android | Google Pixel 8 Pro (v14.0) | 25.84s | @mm-perps-engineering-team | 📹 Watch |
| Seedless Onboarding: Google Login New User | Android | Google Pixel 8 Pro (v14.0) | 11.46s | @metamask-onboarding-team | 📹 Watch |
Branch: feat/ramps-order-syncing · Build: E2E · Commit: 22125bc · View full run
Co-authored-by: Cursor <cursoragent@cursor.com>
Require the chain ID expected by ramps-controller v20 and mock the new ramps order storage read used during E2E startup. Co-authored-by: Cursor <cursoragent@cursor.com>
|
@SocketSecurity ignore npm/@metamask-previews/ramps-controller@20.0.0-preview-8c482076b Reviewed the preview package's order-sync feature: network access is expected because |
4355153 to
cc82603
Compare
There was a problem hiding this comment.
Cursor Bugbot has reviewed your changes and found 1 potential issue.
❌ Bugbot Autofix is OFF. To automatically fix reported issues with cloud agents, have a team admin enable autofix in the Cursor dashboard.
Reviewed by Cursor Bugbot for commit cc82603. Configure here.
SmokeMoney buy flows push synced orders via PUT after completion; cover collection and entry writes like other Backup & Sync features. Co-authored-by: Cursor <cursoragent@cursor.com>
🔍 Smart E2E Test Selection
click to see 🤖 AI reasoning detailsE2E Test Selection: Performance Test Selection: |
|




Description
Syncs V2 buy/sell order history through Backup & Sync so orders created on Mobile can appear on other Mobile devices, Extension, and Portfolio for the same SRP/Profile Sync profile. It adds the Buy & sell orders setting, runs order sync after unlock when all identity and privacy gates are enabled, and keeps Activity rows distinct when providers reuse placeholder transaction hashes.
Missing ramps-sync toggle values on upgraded wallets default to enabled, matching new installs.
Companion PRs:
Implementation notes:
RampsController.syncOrdersWithUserStorage()fromuseIdentityEffectsafter unlock.txHashis missing orDUMMY_TX_ID, and normalizescreatedAtfor Activity sorting.Changelog
CHANGELOG entry: Added Backup & Sync support for buy and sell order history
Related issues
Refs: MetaMask/core#9474
Manual testing steps
Automated coverage includes order-sync gating, controller messenger wiring, Activity adapter fallback IDs, settings UI, and controller initialization.
Screenshots/Recordings
N/A — the change adds another row using the existing Backup & Sync settings-toggle component and does not introduce a new layout or interaction pattern.
Pre-merge author checklist
Performance checks (if applicable)
The performance items were assessed as not applicable to this profile-sync integration; CI performance checks remain non-blocking.
Pre-merge reviewer checklist
Note
Medium Risk
Touches Backup & Sync / User Storage for financial order history and expands RampsController messenger permissions, with preview controller package pins until Core publishes.
Overview
Enables Backup & Sync for V2 buy/sell order history so Mobile orders can appear on other signed-in clients sharing the same profile.
Adds a Buy & sell orders toggle in Backup & Sync settings, a
useRampsOrderSyncinghook that callsRampsController.syncOrdersWithUserStorage()when identity/privacy gates pass, and wires that intouseIdentityEffects. MissingisRampsSyncingEnabledvalues default to enabled on upgrade.Delegates User Storage and auth messenger actions to
RampsController, tracks order-sync error situations, and requires a non-emptychainIdwhen registering precreated orders. Also treats placeholder hashes likeDUMMY_TX_IDas invalid Activity keys and normalizescreatedAttimestamps so synced orders stay distinct and sortable.Pins preview
@metamask/ramps-controller/@metamask/profile-sync-controllerbuilds until the companion Core release lands.Reviewed by Cursor Bugbot for commit 0609d30. Bugbot is set up for automated code reviews on this repo. Configure here.