fix: mising required params error due to race in mounting superposition configs - #552
Merged
Conversation
13 tasks
manideepk90
approved these changes
Aug 7, 2026
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Add this suggestion to a batch that can be applied as a single commit.This suggestion is invalid because no changes were made to the code.Suggestions cannot be applied while the pull request is closed.Suggestions cannot be applied while viewing a subset of changes.Only one suggestion per line can be applied in a batch.Add this suggestion to a batch that can be applied as a single commit.Applying suggestions on deleted lines is not supported.You must change the existing code in this line in order to create a valid suggestion.Outdated suggestions cannot be applied.This suggestion has been applied or marked resolved.Suggestions cannot be applied from pending reviews.Suggestions cannot be applied on multi-line comments.Suggestions cannot be applied while the pull request is queued to merge.Suggestion cannot be applied right now. Please check back later.
Type of Change
What & Why
A. Fixes
/confirmfailing withIR_04 "Missing required param: payment_method_data"Fixes
/confirmfailing withIR_04 "Missing required param: payment_method_data"when the card form renders empty and Pay is still tappable.Root cause: The card form's fields come from the superposition configuration service, which is fetched asynchronously and stored in a module-level
refwith no re-render mechanism. If fields are computed before the config loads, zero fields are returned, the card form silently renders nothing, and the Pay button — not gated on config readiness — stays active. Tapping Pay sends a confirm body withbilling(prefilled from PMLrequired_fields) but nocard, causing the 400. It "works on the next open" only because the module-levelrefpersists across the runtime and is populated by then.Fix: The config hook now exposes a completion signal (
isInitialized) threaded throughDynamicFieldsContextto every consumer. It:useMemodependency list, so fields recompute from empty → populated when the config lands.B. Fixes paymentSheet drop-offs with error: "APPLE_PAY_PRESENT_FAIL_FROM_NATIVE"
5000msto10000ms.Screenshots / Recordings
Screen.Recording.2026-07-29.at.3.56.24.PM.mov
Affected Area & Impact
Android PR / status (if any):
iOS PR / status (if any):
Shared Codebase PR / status (if any): juspay/hyperswitch-sdk-utils#84
Testing
Notes:
Reproduced by injecting latency into the config load (temporary in-code delay before
service := ..., and a mock-server proxyGET /s3-proxy/<path>?delay=<ms>inmockServer.js). With a delay active, opening the Card tab and tapping Pay within the window reproduces the failure (confirm body withbilling, nocard,IR_04). After the fix, the Pay button stays in a loading state until the config lands, then the card form renders and payment succeeds.Checklist