Repository navigation
Conversation
|
Update: I was testing, but found some visual bug that is not related to the issue directly, but decided to fix it since I'm already working on that component. |
|
Update: found another bug/issue that could be fixed that works the same on main. Working on it |
|
@codex review |
|
There's a slight visual change in the card-auth screen. Here're the reasons and context for this change:
|
|
@mountiny I tried to fix as many things that looked wrong that are currently on main, but one bug isn't fixable on FE. Tabbing between Wallet and Subscription causes this flicker: bug.mp4@mountiny Is this smth that even needs to be fixed? Should I file an issue for it? A more concrete mechanism is this: |
|
@parasharrajat Please copy/paste the Reviewer Checklist from here into a new comment on this PR and complete it. If you have the K2 extension, you can simply click: [this button] |
|
@codex review |
There was a problem hiding this comment.
💡 Codex Review
Here are some automated review suggestions for this pull request.
Reviewed commit: 43fec88a82
ℹ️ About Codex in GitHub
Codex has been enabled to automatically review pull requests in this repo. Reviews are triggered when you
- Open a pull request for review
- Mark a draft as ready
- Comment "@codex review".
If Codex has suggestions, it will comment; otherwise it will react with 👍.
When you sign up for Codex through ChatGPT, Codex can also answer questions or update the PR, like "@codex address that feedback".
| function WorkspaceOwnerChangeWrapperPage({route, policy, isLoadingPolicy}: WorkspaceOwnerChangeWrapperPageProps) { | ||
| const styles = useThemeStyles(); | ||
| const {translate} = useLocalize(); | ||
| useNavigateToCardAuthenticationOnLink(); |
There was a problem hiding this comment.
can we move it later where other effects are so that it is easy to spot? let's do it in each component.
There was a problem hiding this comment.
sure, not a problem. On one hand it's just a hook like any other, on the other hand, the hook inside uses useEffect, so moving it closer to other useEffects won't hurt.
|
@parasharrajat I've applied the changes you suggested , but also changed slightly the logic. |
|
@codex review |
There was a problem hiding this comment.
💡 Codex Review
Here are some automated review suggestions for this pull request.
Reviewed commit: 1041f71f6d
ℹ️ About Codex in GitHub
Codex has been enabled to automatically review pull requests in this repo. Reviews are triggered when you
- Open a pull request for review
- Mark a draft as ready
- Comment "@codex review".
If Codex has suggestions, it will comment; otherwise it will react with 👍.
When you sign up for Codex through ChatGPT, Codex can also answer questions or update the PR, like "@codex address that feedback".
| Onyx.merge(ONYXKEYS.FORMS.ADD_PAYMENT_CARD_FORM_DRAFT, { | ||
| [INPUT_IDS.CURRENCY]: currency, | ||
| }); |
There was a problem hiding this comment.
Clear add-card currency draft when resetting the form
Because this setter now writes the selected currency to ADD_PAYMENT_CARD_FORM_DRAFT, the existing clearPaymentCardFormErrorAndSubmit() calls on the add-card pages no longer reset that value. If a user opens any add-card flow, selects EUR/GBP, then backs out before submitting, reopening a later add-card form will hydrate the stale draft instead of the current preferred/billing currency and can submit the card in the wrong currency/force the SCA path unexpectedly. Please clear the draft alongside the form reset or otherwise scope it to the active attempt.
Useful? React with 👍 / 👎.
There was a problem hiding this comment.
resolved with also clearing draft on clear cb
|
@codex review |
There was a problem hiding this comment.
💡 Codex Review
Here are some automated review suggestions for this pull request.
Reviewed commit: 6bad05980b
ℹ️ About Codex in GitHub
Codex has been enabled to automatically review pull requests in this repo. Reviews are triggered when you
- Open a pull request for review
- Mark a draft as ready
- Comment "@codex review".
If Codex has suggestions, it will comment; otherwise it will react with 👍.
When you sign up for Codex through ChatGPT, Codex can also answer questions or update the PR, like "@codex address that feedback".
| return; | ||
| } | ||
| clearPaymentCard3dsVerification(); | ||
| setVerify3dsSubscriptionSource(source); |
There was a problem hiding this comment.
Tie the 3DS source to the response, not the latest attempt
When two 3DS-producing requests overlap, this single global source can be overwritten before the older response writes VERIFY_3DS_SUBSCRIPTION. For example, if a user clicks Authenticate payment, then starts Change payment card and submits an SCA card before the first response returns, the add-card call updates the source to the add-card route; a late auth-payment link will then satisfy route.name === source on the add-card screen and open the wrong challenge. The source needs to be associated with the link/request being consumed rather than stored as the latest global producer.
Useful? React with 👍 / 👎.
There was a problem hiding this comment.
synced source to SCA_URL
|
@codex review |
There was a problem hiding this comment.
💡 Codex Review
Here are some automated review suggestions for this pull request.
Reviewed commit: 9765b39762
ℹ️ About Codex in GitHub
Codex has been enabled to automatically review pull requests in this repo. Reviews are triggered when you
- Open a pull request for review
- Mark a draft as ready
- Comment "@codex review".
If Codex has suggestions, it will comment; otherwise it will react with 👍.
When you sign up for Codex through ChatGPT, Codex can also answer questions or update the PR, like "@codex address that feedback".
|
@codex review |
|
Codex Review: Didn't find any major issues. Already looking forward to the next diff. Reviewed commit: ℹ️ About Codex in GitHubCodex has been enabled to automatically review pull requests in this repo. Reviews are triggered when you
If Codex has suggestions, it will comment; otherwise it will react with 👍. When you sign up for Codex through ChatGPT, Codex can also answer questions or update the PR, like "@codex address that feedback". |
|
@codex review |
There was a problem hiding this comment.
💡 Codex Review
Here are some automated review suggestions for this pull request.
Reviewed commit: 9765b39762
ℹ️ About Codex in GitHub
Codex has been enabled to automatically review pull requests in this repo. Reviews are triggered when you
- Open a pull request for review
- Mark a draft as ready
- Comment "@codex review".
If Codex has suggestions, it will comment; otherwise it will react with 👍.
When you sign up for Codex through ChatGPT, Codex can also answer questions or update the PR, like "@codex address that feedback".
| <InputWrapper | ||
| value={data?.currency ?? CONST.PAYMENT_CARD_CURRENCY.USD} | ||
| defaultValue={preferredCurrency} |
There was a problem hiding this comment.
Keep EUR out of defaults without the billing beta
For a user with no existing billing card whose local currency is EUR and who is not in CONST.BETAS.EUR_BILLING, usePreferredCurrency() returns EUR here and the form submits that default if the user does not change it. The selector still filters EUR out unless the beta is enabled, so this bypasses the same gating and can start the EUR/SCA add-card flow for users who cannot select EUR explicitly; clamp the default to the enabled currency options (or USD) when EUR billing is unavailable.
Useful? React with 👍 / 👎.
There was a problem hiding this comment.
Refactored code to gate behind a check.
|
Thanks for the patience, great job pushing this head! @sharabai can you please ping me in slack once you resolve |
mountiny
left a comment
There was a problem hiding this comment.
(Vit's agent) Requesting changes for one regression: Retry payment no longer opens the 3DS challenge for users who have an SCA billing card (GBP or EUR) and owe money.
On main
- The user presses Retry payment on Subscription, which calls
clearOutstandingBalance(). - When Stripe asks for 3DS,
ClearOutstandingBalancefails with409 Stripe requires authentication. The response'sonyxDatastill setsverify3dsSubscriptionto the new link and updatespurchaseList. - The CardSection effect sees the new link and
hasFailedLastBilling, opens Add Payment Card, and the modal shows the challenge.
On this branch
- The same request returns the same 409, and the link lands in Onyx.
useNavigateToCardAuthenticationOnLinkonly navigates whenroute.name === verify3dsSubscriptionSource.clearOutstandingBalancerecords no source, so the hook returns early and nothing opens.- The user has no other way in. Authenticate payment only renders when
amountOwed === 0(hasCardAuthenticatedError), and these users owe money. Each retry fails and no challenge appears.
One caveat: nothing clears verify3dsSubscriptionSource. If an earlier Authenticate payment click left it set to the Subscription root screen, a retry link still opens the challenge. For these users the source is usually empty or points to another screen, so the bug shows in the common case.
Suggested fix
- Pass
route.namefromhandleRetryPaymentintoclearOutstandingBalance(source). - In
clearOutstandingBalance, callprepareCardAuthentication(source)before the write, so an identical link still counts as a change. - Add
getVerify3dsSubscriptionSourceData(source)to its failureData, because the 3DS case comes back as a 409 and successData never runs. - Add a unit test that mocks a 409 response carrying
verify3dsSubscriptioninonyxDataand checks that the source lands.
SCREENS.SETTINGS.SUBSCRIPTION.ROOT is already an entry screen for card-authentication, so the route itself needs no change.
I traced this through the client and server code and did not run it end to end. A local repro needs a GBP or EUR billing card where Stripe asks for 3DS on the charge, plus an amount owed.
| @@ -214,15 +215,8 @@ function CardSection() { | |||
| clearOutstandingBalance(); | |||
There was a problem hiding this comment.
(Vit's agent) For SCA cards this call can come back as a 409 with a new verify3dsSubscription link. It records no verify3dsSubscriptionSource, so useNavigateToCardAuthenticationOnLink ignores that link and the challenge never opens. Passing route.name here, and recording it in the failureData of clearOutstandingBalance, brings the challenge back. The review summary has the details.
|
@mountiny thanks for the review! Added Given/When/Then to the new tests. |
mountiny
left a comment
There was a problem hiding this comment.
Thanks for addressing those
|
For QA, we will need to test with real cards on staging I think |
|
@allgandalf we'll do one more test on native as well and update the reviewer checklist so it passes. |
There was a problem hiding this comment.
@allgandalf we'll do one more test on native as well and update the reviewer checklist so it passes.
Just realised there is nothing to test on native since we hide this on ios and android 😭 : PR lgtm, lets merge, web test worked fine
Reviewer Checklist
Screenshots/VideosAndroid: HybridAppAndroid: mWeb ChromeiOS: HybridAppiOS: mWeb SafariMacOS: Chrome / Safari |
|
latest qa video 91982-qa-web.mp4 |
mountiny
left a comment
There was a problem hiding this comment.
@allgandalf thanks for thorough testing, changes look good to me and we will see how we can qa this in staging
|
🚧 mountiny has triggered a test Expensify/App build. You can view the workflow run here. |
|
🧪🧪 Use the links below to test this adhoc build on Android, iOS, and Web. Happy testing! 🧪🧪
|
|
✋ This PR was not deployed to staging yet because QA is ongoing. It will be automatically deployed to staging after the next production release. |
|
🚀 Deployed to staging by https://github.com/mountiny in version: 9.5.8-0 🚀
|
|
No help site update needed. This PR moves the 3DS screen into navigation and fixes how the currency default and the Authenticate payment button behave. No existing article sentence becomes wrong. Fix a Billing Issue still correctly says "Complete the required authentication, such as 3D Secure verification." The EUR currency behavior is behind the |
|
Thorough testing done by @allgandalf |
|
🚀 Deployed to production by https://github.com/cristipaval in version: 9.5.8-5 🚀
Bundle Size Analysis (Sentry): |


Explanation of Change
Migrates the inline
CardAuthenticationModal(react-native-modal) to a real@react-navigationscreen (DynamicCardAuthenticationPage), reachable via the dynamiccard-authenticationURL suffix. Native is intentionally inert (3DS on mobile is handled by OldDot).Important
Behavior changes on top of the migration (improvements, not regressions):
transparentModalscreen options (centeredModalNavigator) as the other route-based centered modals, so the screen that triggered it (e.g. the Add Payment Card RHP) stays visible behind a dimmed backdrop; clicking the backdrop or pressing Esc cancels the challenge, matching the old modal's backdrop behavior.styles.getCardAuthenticationModalInnerViewhelper whose values come from the old modal'sCENTERED_UNSWIPEABLEcontainer inModalStyleUtils— fills the screen with a 20px inset,componentBorderRadiusLargecorners and a shadow on wide layouts; full-bleed with square corners on narrow (the inset is expressed as margins instead of the originalwindowWidth - 40width computation, which drops the window-dimensions dependency). ReusinggetModalStylesdirectly was rejected because its output is coupled to thereact-native-modalcontract (animationIn/animationOut,swipeDirection, safe-area flags) that a navigation route doesn't consume, and it would couple the migrated route back to the legacy modal system it's leaving — future tweaks meant for the remainingCENTERED_UNSWIPEABLEconsumers would silently restyle this route. The existinggetCenteredModalInnerViewwasn't a fit either: it's built for fixed-width, content-hugging dialog cards (feature training, welcome modals) with a bottom-sheet shape on narrow layouts, and can't express a screen-filling card for an iframe with no intrinsic height. This mirrors how the other migrated surfaces do it (getTestToolsNavigatorInnerView,getCenteredModalInnerVieware also per-surface helpers).usePreferredCurrency(billing-card currency → local currency → USD) everywhere — the Add Payment Card form's selector button, the currency picker, and Change Billing Currency. Previously the button and picker derived the default differently, so the button could show one currency while the picker opened pre-selected on another.EUR_BILLINGbeta.usePreferredCurrencycan resolve to EUR (from the user's local currency) regardless of the beta, but the currency picker only offers EUR when the beta is on. So on the add-card entry points (the Add Payment Card form default and the picker's pre-selected row) a EUR default is clamped to USD when the beta is off — keeping the default in sync with the options the user can actually pick and avoiding an unintended EUR/SCA add-card for users who can't select EUR. Change Billing Currency stays ungated, since it reflects an existing card's real currency.ADD_PAYMENT_CARD_FORM_DRAFT, whichFormProviderhydrates from) so the form no longer reverts after picking EUR/GBP and returning; the Change Billing Currency flow writes its own draft. Both the read and the write are scoped by entry point, so committing in one flow no longer bleeds into the other — previously both keys were written on every commit, which is why Change Billing Currency carried an unmount cleanup (setPaymentMethodCurrency(initialCurrency)) purely to undo the add-card half; scoping the write lets that cleanup be deleted rather than kept.clearPaymentCardFormErrorAndSubmit(run on add-card open/close) also clears the draft currency, so a fresh attempt re-defaults throughusePreferredCurrencyrather than hydrating a currency abandoned in an earlier attempt. That reset-on-open behaviour is long-standing but was never a recorded decision: it arrived in #43572 as a side effect of a form-wideOnyx.setwhose only stated purpose was clearing stale submission errors, and no PR description or test pins it. Moving the currency to the draft key would have silently dropped it, so this PR keeps it deliberately rather than changing behaviour nobody asked to change.Note on provenance: the picker commits on Save rather than on row tap as of #97075, which landed on
mainwhile this PR was open and is merged in here. The per-flow scoping above applies to that Save handler; the deferred-commit interaction itself is not this PR's change.payment-card-currencydynamic route, so the currency picker no longer 404s from that flow.VerifySetupIntentrequest each (up to ~9 back-to-back). The button'sisLoadingis now bound to a new optimistic Onyx flag (SUBSCRIPTION_VERIFY_SETUP_INTENT_PENDING), set in the request'soptimisticDataand cleared insuccessData/failureData— so the button shows a spinner and additional clicks are no-ops until the response lands.verify3dsSubscriptionis a single global Onyx key, so previously clicking Authenticate payment and then opening Change payment card would let the in-flight auth link open the challenge iframe on top of the Add Payment Card page — unexpected, since by then the user means to start a fresh add-card flow. The producing request now records its ownroute.nameinverify3dsSubscriptionSourcevia itssuccessData, so the source lands in the same Onyx flush as that response's link and stays tied to it (overlapping requests can't make the source point at a different attempt than the link). The navigation hook only reacts to a link when the focused screen matches that source — so a link can no longer be consumed by an unrelated screen the user has since navigated to.verify3dsSubscription, and the backend hands back the same link on retries. Rather than clearing the link from multiple consumer spots (on close, on orphan), every link-producing action now clears it first at a single seam (prepareCardAuthentication, gated by the presence of asource) before issuing its request — so the response, new or identical, always lands as a'' → URLchange. Stale links from an abandoned attempt or a reload are inert at mount (the mount-time run is skipped) and overwritten by the next attempt.Fixed Issues
$ #90477
Tests
Setup for Flow A / D: the Account → Subscription menu item only shows if you own a paid workspace. If you don't see it, create a workspace and switch its plan to Control.
Flow A — Subscription add card
/card-authentication, and the card is added.usePreferredCurrencyinstead of showing GBP.Flow B — Teachers Unite add card (requires an account with no billing card on file — easiest is a fresh test account)
Flow C — Workspace owner change (needs two accounts: Owner A and Admin B)
/card-authenticationsuffix is removed, and exiting the owner-change flow returns to the screen it was opened from without abackToquery parameter.Flow D — Re-authenticate existing billing (only stageable when last billing failed with auth-required)
/settings/subscription/card-authentication(no Add Payment Card detour).Navigation edge cases (run on Flow A):
…/card-authentication/card-authentication) and back still returns to the parent.Offline tests
Same as tests.
QA Steps
Same as tests.
PR Author Checklist
### Fixed Issuessection aboveTestssectionOffline stepssectionQA stepssectiontoggleReportand notonIconClick)src/languages/*files and using the translation methodSTYLE.md) were followedAvatar, I verified the components usingAvatarare working as expected)StyleUtils.getBackgroundAndBorderStyle(theme.componentBG))npm run compress-svg)Avataris modified, I verified thatAvataris working as expected in all cases)Designlabel and/or tagged@Expensify/designso the design team can review the changes.ScrollViewcomponent to make it scrollable when more elements are added to the page.mainbranch was merged into this PR after a review, I tested again and verified the outcome was still expected according to theTeststeps.Screenshots/Videos
Android: Native
Android: mWeb Chrome
iOS: Native
iOS: mWeb Safari
MacOS: Chrome / Safari
the.world.mp4
change.card.with.fail.auth.payment.auth.to.change.card.page.mp4
change.ownership.mp4