[HOLD Auth] Prevent repeated bank account unlock requests from being sent - #99792
[HOLD Auth] Prevent repeated bank account unlock requests from being sent#99792akinwale wants to merge 7 commits into
Conversation
|
Hey, I noticed you changed If you want to automatically generate translations for other locales, an Expensify employee will have to:
Alternatively, if you are an external contributor, you can run the translation script locally with your own OpenAI API key. To learn more, try running: npx bun ./scripts/generateTranslations.ts --helpTypically, you'd want to translate only what you changed by running |
|
This PR adds a new |
There was a problem hiding this comment.
💡 Codex Review
Here are some automated review suggestions for this pull request.
Reviewed commit: 5c3a1c99a7
ℹ️ 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".
| if (initiatingBankAccountUnlock?.isLoading && initiatingBankAccountUnlock?.bankAccountIDToUnlock === bankAccountID) { | ||
| return; | ||
| } |
There was a problem hiding this comment.
Track each in-flight bank account independently
When multiple locked accounts are acted on before their requests finish, this singleton guard remembers only the latest ID. For example, pressing A, then B, then A while responses are slow makes the third call see B as bankAccountIDToUnlock, bypass the guard, and enqueue a second unlock request for A. Track in-flight state per bank-account ID so alternating between accounts cannot evade deduplication.
Useful? React with 👍 / 👎.
There was a problem hiding this comment.
This is based on the existing implementation. Implementing per bank account ID would require a major refactor and is not in scope for this PR.
| Onyx.connectWithoutView({ | ||
| key: ONYXKEYS.INITIATING_BANK_ACCOUNT_UNLOCK, | ||
| callback: (value) => (initiatingBankAccountUnlock = value), | ||
| }); |
There was a problem hiding this comment.
Explain the direct Onyx connection
This new Onyx.connectWithoutView read has no comment justifying why the action layer needs a direct subscription. The repository's delegated Onyx guidance explicitly requires each such read to be justified rather than copied as a pattern, so add the rationale next to this connection.
AGENTS.md reference: AGENTS.md:L1-L3
Useful? React with 👍 / 👎.
There was a problem hiding this comment.
Removed the call in favour of passing the Onyx value to the method calls.
Codecov Report❌ Looks like you've decreased code coverage for some files. Please write tests to increase, or at least maintain, the existing level of code coverage. See our documentation here for how to interpret this table.
|
Sorry about the noise. I removed the |
Explanation of Change
For locked bank accounts, prevent multiple repeated unlock account requests being sent when the user clicks on the button to Fix or Unlock the bank account.
Fixed Issues
$ https://github.com/Expensify/Expensify/issues/673219
PROPOSAL: https://github.com/Expensify/Expensify/issues/673219#issue-5195034188
Tests
Prerequisites
Test Steps
Offline tests
QA Steps
PR Author Checklist
### Fixed Issuessection aboveTestssectionOffline stepssectionQA stepssectionAvatar, 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.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
Screen.Recording.2026-08-28.at.14.37.20.mp4
Screen.Recording.2026-08-28.at.14.38.04.mp4
Screen.Recording.2026-08-28.at.14.40.22.mp4