Skip to content

feat(ramps): add autoramp accounts, NeoBankService, and User Storage sync - #9848

Open
georgeweiler wants to merge 1 commit into
mainfrom
cursor/ramps-autoramp-accounts
Open

feat(ramps): add autoramp accounts, NeoBankService, and User Storage sync#9848
georgeweiler wants to merge 1 commit into
mainfrom
cursor/ramps-autoramp-accounts

Conversation

@georgeweiler

Copy link
Copy Markdown
Contributor

Summary

  • Add AutorampAccount state and lifecycle helpers to RampsController (refresh, push apply, notify), separate from RampsOrder.
  • Introduce NeoBankService to call MetaMask Ramp API neo-bank proxy endpoints (GET /api/v2/autoramps/{id}) with bearer auth.
  • Add rampsAutoramps User Storage sync (LWW merge, soft deletes, incremental push) gated on Backup & Sync + signed-in.

Test plan

  • yarn workspace @metamask/ramps-controller test (or focused: autorampAccount, NeoBankService, autoramp-syncing, RampsController autoramp cases)
  • Confirm messenger hosts can delegate RAMPS_CONTROLLER_REQUIRED_SERVICE_ACTIONS + RAMPS_CONTROLLER_AUTORAMP_SYNC_ACTIONS
  • Manual: after unlock with B&S on, syncAutorampsWithUserStorage() then refreshAutoramps() updates local status from neo-bank proxy

Made with Cursor

…sync

Introduce AutorampAccount state in RampsController with refresh/compare helpers, a NeoBankService Ramp API proxy client, and rampsAutoramps Profile Sync for cross-device last-seen status.

Co-authored-by: Cursor <cursoragent@cursor.com>
@georgeweiler
georgeweiler requested review from a team as code owners August 12, 2026 16:57
@georgeweiler
georgeweiler deployed to default-branch August 12, 2026 16:57 — with GitHub Actions Active

@cursor cursor Bot left a comment

Copy link
Copy Markdown

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Cursor Bugbot has reviewed your changes and found 3 potential issues.

Fix All in Cursor

❌ 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 176da6a. Configure here.

[{ ...account, updatedAt: Date.now() }],
options,
config,
);

Copy link
Copy Markdown

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Incremental sync breaks LWW

High Severity

updateAutorampInRemoteStorage always rewrites updatedAt to Date.now() before upload, instead of keeping the account’s existing timestamp like the full-sync upload path. A device with older status can therefore win last-write-wins and overwrite a newer remote status in User Storage.

Fix in Cursor Fix in Web

Reviewed by Cursor Bugbot for commit 176da6a. Configure here.

updatedAt: Date.now(),
depositRailsSummary:
remote.depositRailsSummary ?? local.depositRailsSummary,
};

Copy link
Copy Markdown

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

No-op apply clobbers metadata

Medium Severity

applyAutorampRemoteStatus always sets lastSeenStatus to the current status and bumps updatedAt, even when the remote status did not change. Repeated refresh/push with the same status erases prior transition history and advances the LWW clock without a real change.

Fix in Cursor Fix in Web

Reviewed by Cursor Bugbot for commit 176da6a. Configure here.

upserted,
this.#getAutorampSyncingOptions(),
).catch(() => undefined);
}

Copy link
Copy Markdown

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Refresh always pushes storage

Medium Severity

#applyAutorampRemoteSnapshot always calls updateAutorampInRemoteStorage after apply, including when status and other syncable fields did not change. Because User Storage omits depositRailsSummary, these writes mostly mint newer lu timestamps and amplify cross-device last-write-wins conflicts.

Fix in Cursor Fix in Web

Reviewed by Cursor Bugbot for commit 176da6a. Configure here.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

1 participant