Skip to content

fix(routing): cache redaction on updation of mca#9729

Merged
likhinbopanna merged 6 commits intomainfrom
fix-routing
Oct 8, 2025
Merged

fix(routing): cache redaction on updation of mca#9729
likhinbopanna merged 6 commits intomainfrom
fix-routing

Conversation

@prajjwalkumar17
Copy link
Member

@prajjwalkumar17 prajjwalkumar17 commented Oct 7, 2025

Type of Change

  • Bugfix
  • New feature
  • Enhancement
  • Refactoring
  • Dependency updates
  • Documentation
  • CI/CD

Description

This pull request refactors how the default fallback routing configuration is updated when a merchant connector account is modified. Instead of calling the old helper function, the logic is now handled through a new MerchantDefaultConfigUpdate struct with methods that more explicitly update or remove the connector from the routing algorithm, depending on whether the connector is disabled. The changes also ensure that the connector update uses a clone of the merchant connector account object.

Routing configuration update refactor:

  • Replaces the old update_default_fallback_on_mca_update helper with explicit logic using the MerchantDefaultConfigUpdate struct, which updates or deletes the connector from the default fallback routing algorithm based on the connector's status. This makes the update process more modular and easier to maintain. [1] [2]
  • Removes the now-unused update_default_fallback_on_mca_update function from routing/helpers.rs.

Code quality and correctness:

  • Ensures the update_merchant_connector_account call receives a clone of the mca object, preventing potential issues with ownership or mutation.
  • Cleans up imports by removing the now-unused update_default_fallback_on_mca_update import.

Additional Changes

  • This PR modifies the API contract
  • This PR modifies the database schema
  • This PR modifies application configuration/environment variables

Motivation and Context

How did you test it?

Checklist

  • I formatted the code cargo +nightly fmt --all
  • I addressed lints thrown by cargo clippy
  • I reviewed the submitted code
  • I added unit tests for my changes where possible

@prajjwalkumar17 prajjwalkumar17 self-assigned this Oct 7, 2025
@prajjwalkumar17 prajjwalkumar17 requested review from a team as code owners October 7, 2025 19:17
@prajjwalkumar17 prajjwalkumar17 added the A-routing Area: Routing label Oct 7, 2025
@semanticdiff-com
Copy link

semanticdiff-com bot commented Oct 7, 2025

Review changes with  SemanticDiff

Changed Files
File Status
  crates/router/src/core/admin.rs  5% smaller
  crates/router/src/core/routing/helpers.rs  0% smaller

Sarthak1799
Sarthak1799 previously approved these changes Oct 7, 2025
@likhinbopanna likhinbopanna added this pull request to the merge queue Oct 8, 2025
Merged via the queue into main with commit b52aafa Oct 8, 2025
22 of 25 checks passed
@likhinbopanna likhinbopanna deleted the fix-routing branch October 8, 2025 08:06
UdayPandey01 pushed a commit to UdayPandey01/hyperswitch that referenced this pull request Oct 8, 2025
Co-authored-by: hyperswitch-bot[bot] <148525504+hyperswitch-bot[bot]@users.noreply.github.com>
aadityaguptaa pushed a commit that referenced this pull request Nov 10, 2025
Co-authored-by: hyperswitch-bot[bot] <148525504+hyperswitch-bot[bot]@users.noreply.github.com>
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

A-routing Area: Routing

Projects

None yet

Development

Successfully merging this pull request may close these issues.

refactor(routing): update configs on updation of mca

4 participants