Fix company card assignment for commercial cards feed#79625
Fix company card assignment for commercial cards feed#79625joekaufmanexpensify merged 40 commits intoExpensify:mainfrom
Conversation
…useAssignCard hook and related components
…rom CompanyCards actions and components
…for improved readability and maintainability
…ONYXKEYS and related components
Codecov Report✅ Changes either increased or maintained existing code coverage, great job!
|
…ber encryption logic and update WorkspaceCompanyCardsTable to utilize it
… ConfirmationStep to use encryptedCardNumber correctly
|
@ShridharGoel 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] |
There was a problem hiding this comment.
💡 Codex Review
Here are some automated review suggestions for this pull request.
Reviewed commit: b14bffd5f3
ℹ️ About Codex in GitHub
Your team has set up Codex to 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 👍.
Codex can also answer questions or update the PR. Try commenting "@codex address that feedback".
src/pages/workspace/companyCards/WorkspaceCompanyCardsTable/WorkspaceCompanyCardsTableItem.tsx
Outdated
Show resolved
Hide resolved
src/pages/workspace/companyCards/assignCard/ConfirmationStep.tsx
Outdated
Show resolved
Hide resolved
There was a problem hiding this comment.
💡 Codex Review
Here are some automated review suggestions for this pull request.
Reviewed commit: b14bffd5f3
ℹ️ About Codex in GitHub
Your team has set up Codex to 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 👍.
Codex can also answer questions or update the PR. Try commenting "@codex address that feedback".
src/pages/workspace/companyCards/WorkspaceCompanyCardsTable/WorkspaceCompanyCardsTableItem.tsx
Outdated
Show resolved
Hide resolved
src/pages/workspace/companyCards/assignCard/ConfirmationStep.tsx
Outdated
Show resolved
Hide resolved
|
@fedirjh why are you removing the logic for failed company card assignments here? This was mainly for displaying a pending failed card assignment for failed network requests. I think we still want to be able to show that pending action |
@ikevin127 Is this bug caused by the change in this PR or has it already existed before? |
Not caused by a change in this PR, already exists on staging - it's BE related most likely. |
I think we should tackle it in a followup PR.
This should be fixed. |
@fedirjh Just checked again after latest commits and it's still happening, here's what I'm actually doing:
What happens, upon refresh user sees 🔴 "Card assignment failed." and the optimistic row shows default name that was in the flow at assignment time -> but once error is cleared manually - the Card name is empty on the row while card remains assigned to the user. The case where the Card name is empty depends on how fast after pressing
Screen.Recording.2026-01-16.at.17.35.44.mov |
I am not sure if I understand the bug correctly. I have updated the assignCard command to throw an error, and it's working as expected : CleanShot.2026-01-17.at.03.04.26.mp4
Also commands in dev runs in |
ikevin127
left a comment
There was a problem hiding this comment.
I posted videos as well - can't explain it more than I already did + videos, so if you think everything works as expected then I'm fine to move forward 👍
…nt logic in CompanyCards and WorkspaceCompanyCardsTable
|
I see the error, I think this is an edge case and not sure if this can be fixed, It seems the app aborts the first request to assign the card, but that request already reached the BE, Since that request is aborted, the app will try to run a new request which will fail because of the previous one already assigned the card. The problem is that the first request should return data about that assigned card, which includes the card name. I have pushed a fix to use the default name in case the card name is missing. @ikevin127 Could you retest it? |
|
I retested, Card name is still not showing on the row in specific case when refreshed right away. BE response when this happens: {
"code": 666,
"jsonCode": 666,
"type": "Expensify\\Libs\\Error\\ExpError",
"UUID": "1d215fbc-6fd8-41fb-881c-b0fba808b1c7",
"message": "This card has already been assigned to this member on a different feed.",
"title": "Unable to assign card",
"data": {
"onyxData": [
{
"onyxMethod": "merge",
"key": "assignCard",
"value": {
"errors": {
"1768622681468262": "This card has already been assigned to this member on a different feed."
}
}
}
]
},
"htmlMessage": "",
"onyxData": [
{
"onyxMethod": "merge",
"key": "assignCard",
"value": {
"errors": {
"1768622681468262": "This card has already been assigned to this member on a different feed."
}
}
}
],
"requestID": "9bf2f84ee81bed3d-SJC"
}Here are 2 videos with different cases:
Screen.Recording.2026-01-16.at.20.07.32.movScreen.Recording.2026-01-16.at.20.06.57.movI understand there's a BE sync issue - I just wanted to report it since I found it during manual testing and felt it was worth mentioning - if it's not in scope we're all good here - Approved 🟢 |
|
I think both remaining issues are out of scope of this PR, so approved. @tgolen @trjExpensify @joekaufmanexpensify feel free to approve/merge 👍 |
|
@joekaufmanexpensify is product on this: #79625 (review) |
joekaufmanexpensify
left a comment
There was a problem hiding this comment.
Good to go from my perspective. @fedirjh there's an ESLint failing check, could you take a look at that?
|
@joekaufmanexpensify Should be good to merge. |
|
✋ This PR was not deployed to staging yet because QA is ongoing. It will be automatically deployed to staging after the next production release. |
|
@fedirjh nice to meet you! just wanted to ask two questions here:
|
|
Hey @brianlee-expensify Nice to meet you too.
@brianlee-expensify This will be shipped in the next prod deployment. You can subscribe to that in #80009
Yes, they should unassign affected cards, then reassign them, So the fix can take effect. |
|
🚀 Deployed to staging by https://github.com/joekaufmanexpensify in version: 9.3.5-0 🚀
|
|
🚀 Deployed to production by https://github.com/Beamanator in version: 9.3.5-7 🚀
|
Explanation of Change
Fixed a bug in the company cards assignment flow where the
encryptedCardNumberwas incorrectly being passed for feed cards.Fixed Issues
$ #79221
PROPOSAL:
Tests
Test 1:
Test 2:
Preconditions:
Offline tests
N/A
QA Steps
// TODO: These must be filled out, or the issue title must include "[No QA]."
Same As Tests
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
CleanShot.2026-01-15.at.02.49.39.mp4
CleanShot.2026-01-15.at.03.15.54.mp4
Android: Native
Android: mWeb Chrome
iOS: Native
iOS: mWeb Safari
MacOS: Chrome / Safari