Skip to content

Conversation

@georgeweiler
Copy link
Contributor

@georgeweiler georgeweiler commented Jan 23, 2026

Explanation

This PR adds a doNotUpdateState option to ExecuteRequestOptions that enables external consumers to use RampsController methods without modifying the controller's state.

  • Added doNotUpdateState?: boolean to ExecuteRequestOptions in RequestCache.ts
  • Updated getCountries(), getTokens(), getProviders(), and getPaymentMethods() to conditionally skip state updates when doNotUpdateState: true
  • The option is passed through method signatures including setUserRegion() and all trigger methods
  • Request caching and deduplication still work normally - only the domain state updates are skipped

Use Case

External teams consuming the RampsController may need to call API methods (e.g., getTokens, getProviders) to fetch data for display or comparison purposes without polluting the controller's persisted state. For example:

// Fetch tokens for a different region without affecting the user's current state
const otherRegionTokens = await rampsController.getTokens('fr', 'buy', {
  doNotUpdateState: true,
});

References

https://consensyssoftware.atlassian.net/browse/TRAM-3231

Checklist

  • I've updated the test suite for new or updated code as appropriate
  • I've updated documentation (JSDoc, Markdown, etc.) for new or updated code as appropriate
  • I've communicated my changes to consumers by updating changelogs for packages I've changed
  • I've introduced breaking changes in this PR and have prepared draft pull requests for clients and consumer packages to resolve them

Note

Enables external consumers to fetch ramps data without altering controller state.

  • Add doNotUpdateState to ExecuteRequestOptions; wire through getCountries(), getTokens(), getProviders(), getPaymentMethods() and triggerGetPaymentMethods() to conditionally skip state updates
  • Preserve request caching/deduplication and cache keys; expand tests to validate no-state-update behavior and cache updates
  • Update JSDoc and CHANGELOG.md

Written by Cursor Bugbot for commit 910d876. This will update automatically on new commits. Configure here.

@georgeweiler georgeweiler changed the base branch from main to TRAM-3230-controller-init-reorg January 23, 2026 16:40
Base automatically changed from TRAM-3230-controller-init-reorg to main January 23, 2026 22:53
@georgeweiler georgeweiler marked this pull request as ready for review January 23, 2026 23:32
@georgeweiler georgeweiler requested review from a team as code owners January 23, 2026 23:32
@georgeweiler georgeweiler changed the title Tram 3231 no state update options feat(ramps): add option to make requests without updating controller state Jan 23, 2026
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.

2 participants