Conversation
|
@cursoragent fix the change log please. Make it a less specific 1-liner entry for this PR and make sure it passes linting and formatting rules |
Co-authored-by: George Weiler <georgejweiler@gmail.com>
|
@cursoragent fix the changelog merge conflict |
|
I've successfully resolved the changelog merge conflict. Here's what I did: SummaryThe conflict occurred because
The changelog now has the correct structure: ## [Unreleased]
### Changed
- **BREAKING:** Update state hydration to make `init()` idempotent and remove `hydrateState()` ([#8157](https://github.com/MetaMask/core/pull/8157))
## [11.0.0]
## [10.2.0]
...The merge is complete and all changes have been pushed to the |
Co-authored-by: George Weiler <georgejweiler@gmail.com>
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.
| ### Changed | ||
|
|
||
| - **BREAKING:** Replace `getWidgetUrl` with `getBuyWidgetData` (returns `BuyWidget | null`); add `addPrecreatedOrder` for custom-action ramp flows (e.g., PayPal) ([#8100](https://github.com/MetaMask/core/pull/8100)) | ||
| - **BREAKING:** Replace `getWidgetUrl` with `getBuyWidgetData` (returns `BuyWidget | null`); add `addPrecreatedOrder` for custom-action ramp flows (e.g., PayPal, Robinhood, Coinbase) ([#8100](https://github.com/MetaMask/core/pull/8100)) |
There was a problem hiding this comment.
Released changelog entry unintentionally modified
Low Severity
The already-released [11.0.0] changelog entry was modified to add "Robinhood, Coinbase" to the examples list. This change is unrelated to this PR and appears to be an artifact of merge conflict resolution (the PR discussion references "@cursoragent fix the changelog merge conflict"). Released changelog sections are expected to be immutable.




Explanation
This PR refactors
RampsControllerstate hydration so startup is deterministic and safe under repeated calls.init()is now idempotent using an internal#initPromise.init()calls now share the same in-flight promise instead of double-fetching.init()calls after a successful initialization return immediately.init({ forceRefresh: true })to explicitly bypass idempotency and rerun the full initialization flow.getCountries()when countries are already loadeduserRegionalready existshydrateState()fromRampsController(breaking change). Hydration behavior is now part of theinit()flow.init()deduplicationforceRefreshbehaviorReferences
Checklist
Note
Medium Risk
Introduces a breaking API removal (
hydrateState) and changes controller initialization semantics (promise deduping/skip paths/force refresh), which could affect consumers that relied on previous hydration timing or repeated init behavior.Overview
Updates
RampsControllerstartup hydration to be deterministic and safe under repeated calls by makinginit()idempotent via an internal shared#initPromise, withinit({ forceRefresh: true })to explicitly rerun the full initialization flow.Initialization now skips unnecessary work when state is already hydrated (e.g., avoids
getCountrieswhen already loaded and avoids geolocation whenuserRegionexists), and removeshydrateState()entirely (breaking change) soinit()is the single hydration entry point. Tests and the package changelog are updated to cover concurrent init deduplication, post-init no-op behavior, skip paths, and force refresh.Written by Cursor Bugbot for commit 718f684. This will update automatically on new commits. Configure here.