[Company Card] Update RBR logic of admin/member#83159
[Company Card] Update RBR logic of admin/member#83159carlosmiceli merged 12 commits intoExpensify:mainfrom
Conversation
Codecov Report✅ Changes either increased or maintained existing code coverage, great job!
|
|
@MelvinBot please review it in the meantime |
Code ReviewOverall the approach is sound — filtering company card errors by workspace membership in A few observations: 1. Redundant null check (minor)In if (!currentUserLogin || !policies) {
return true;
}This code is inside the 2. Fallback behavior when session/policies not loadedWhen This is probably fine in practice since session loads early, but worth being aware of. If you want to preserve the old behavior as a fallback, you could include all card errors when session/policies aren't available: if (!currentUserLogin || !policies) {
const hasAnyCardError = Object.values(cardList ?? {}).some(
(card) => Object.keys(card?.errors ?? {}).length > 0
);
return hasBankOrFundError || hasAnyCardError;
}Up to you whether this edge case matters. 3.
|
|
@ikevin127 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] |
Code Review - PR #83159Issue 1:
|
There was a problem hiding this comment.
💡 Codex Review
Here are some automated review suggestions for this pull request.
Reviewed commit: acc3a7ec1c
ℹ️ 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".
src/libs/actions/PaymentMethods.ts
Outdated
| if (!currentUserLogin || !policies) { | ||
| return hasBankOrFundError; |
There was a problem hiding this comment.
Preserve card errors when policy data is missing
Returning early with only hasBankOrFundError when policies is missing drops all card-list errors. useNavigationTabBarIndicatorChecks reads policies with canBeMissing: true, so users can temporarily or permanently have policies === undefined (for example accounts without workspace policies), and in that state personal/company card errors no longer trigger HAS_PAYMENT_METHOD_ERROR. Before this change, card errors were always included, so this regresses account-tab error visibility.
Useful? React with 👍 / 👎.
|
@codex review |
There was a problem hiding this comment.
💡 Codex Review
Here are some automated review suggestions for this pull request.
Reviewed commit: 624cece03a
ℹ️ 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".
|
🚧 @joekaufmanexpensify has triggered a test Expensify/App build. You can view the workflow run here. |
This comment has been minimized.
This comment has been minimized.
|
Taking this for review based on Slack |
|
@ShridharGoel Break connection option not displayed |
|
@ShridharGoel @hungvu193 can you please help us? |
|
Do you toggle "Use Staging Server" option? |
|
@kavimuru I've just checked the code and the condition to show the |
|
Oh I think I found the issue. This check is always false on Staging:
@amyevans Do we allow |
|
🚀 Deployed to production by https://github.com/luacmartins in version: 9.3.36-10 🚀
|
|
I just retested this as part of something else, and it's already not working again/. Do we think this is related to another PR @carlosmiceli @hungvu193 @ShridharGoel 2026-03-13_09-18-13.mp4 |
|
Weird. I think there is another PR removed the RBR logic. I'll take a look later today |
|
TY! |
|
@MelvinBot Find the PR that removed the RBR from WorkspaceInitialPage when there's company card with broken connection. |
|
The RBR on WorkspaceInitialPage for company cards with broken connections was restructured (not explicitly removed) by PR #78305 (fix: Handle company Cards errors and initial loading states), merged on 2026-01-26. That PR replaced the old If the RBR is currently not appearing as expected, the more likely culprit is PR #84803 (Add 434 to broken connection ignored statuses for card feeds), merged on 2026-03-11. That PR added TL;DR:
|
|
I think #84803 is the offending. @carlosmiceli Can you confirm? |
|
It's expected as per #84803 (comment) |
|
@joekaufmanexpensify #84803 added |
|
I see. I think this might just be an issue with the |
If we aren't supposed to show the error for this case, why does the error momentarily appear below the card @situchan ? See here. |
The RBR under the card looks redundant. How do you reproduce it btw? I think when the feed connection is broken (RBR in Company Cards and Workspace), we shouldn't show the RBR under the card. |
Agreed. We shouldn't show this second error on the company cards page ever really IMO. We didn't when this PR originally went out. I'm wondering if that other PR caused this? For reproducing, I just broke the feed connection to see it. |
|
@MelvinBot Can you check the PR that added the RBR under the card inside WorkspaceCompanyCardPage? |
|
Here's the history of PRs that added RBR under cards on the WorkspaceCompanyCards page:
If you're specifically asking about the broken connection RBR under cards, PR #78305 is the one that wired up |
After broke card connection, I only see the RBR under the card 🤔 Screen.Recording.2026-03-18.at.10.17.53.mov |
|
I think that's because of this and you using the mock bank. The mock bank uses |
|
IMO, we need to:
|
|
For the 2, I think @amyevans had a draft PR for it. Ideally, we can wait for that PR to be merged so I can reproduce and find the RCA |
|
Works for me! |
|
#85591 is merged. I'll try to reproduce the bug and find the offending/solution. |









Correct the logic of RBR on the Wallet page. Per #78305 (comment):
Explanation of Change
Fixed Issues
$ #81724
PROPOSAL: N/A
Tests
Same as QA Tests.
Offline tests
N/A
QA Steps
// TODO: These must be filled out, or the issue title must include "[No QA]."
PR Author Checklist
### Fixed Issuessection aboveTestssectionOffline stepssectionQA stepssectioncanBeMissingparam foruseOnyxtoggleReportand 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
MacOS: Chrome / Safari
Screen.Recording.2026-02-23.at.13.53.00.mov