fix: Approve and Reject options are not available for Admin after changing workspace#82823
fix: Approve and Reject options are not available for Admin after changing workspace#82823nkdengineer wants to merge 3 commits intoExpensify:mainfrom
Conversation
|
@DylanDylann 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: 4021ca61db
ℹ️ 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".
|
@nkdengineer However, I'm not sure if the logic in getNextApproverAccountID is correct when we change the workspace. Consider this case: the approval chain in the admin workspace is Approver A → Employee → Approver B. When changing the report to the admin workspace, getNextApproverAccountID returns Approver B. Is this correct? Or should approval start from the first approver (Approver A) when switching to a new workspace? |
|
@cead22 Can you please confirm what should be the expected in the case above? |
|
I'm not sure I understand, so it'd be helpful to spell out the whole config and flow.
If I understand correctly, and the report belongs to But |
|
In the admin workspace: First approver: Approver A And the employee moves their expense (from employee's workspace) to the admin workspace chat |
|
@cead22 I thought of this case because @nkdengineer is using getNextApproverAccountID to get the managerID for submitted expense reports when changing workspaces. When changing the workspace of a submitted expense, I think we should point it to the first approver of the new workspace |
Can you share a screenshot or the policy.employeeList for this? |
|
First approver: Admin : dylandylan9112+200134253600@gmail.com
|
|
In the backend PR, we're do the following int64_t newPolicyApproverID = auth.policy.getSubmitsTo(db, policyID, submitterEmail);
...
newManagerID = newPolicyApproverID;This is in line with what you're saying 👍. I assumed Looking at the code, it seems to me like it should return the report's managerID from here https://github.com/Expensify/App/blob/1fd4f51f927/src/libs/ReportUtils.ts#L4721, is that not the case? |
@nkdengineer You're missing isUnapproved. Please add it and verify that this scenario works correctly. |

Explanation of Change
Fixed Issues
$ #80582
PROPOSAL: #80582 (comment)
Tests
Preconditions: Create an Admin and a Member, selecting "Manage my team's expenses" option
Offline tests
None
QA Steps
Same as test
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
Android: Native
Screen.Recording.2026-02-18.at.22.46.41.mov
Android: mWeb Chrome
Screen.Recording.2026-02-18.at.22.47.49.mov
iOS: Native
Screen.Recording.2026-02-18.at.22.45.32.mov
iOS: mWeb Safari
Screen.Recording.2026-02-18.at.22.49.07.mov
MacOS: Chrome / Safari
Screen.Recording.2026-02-18.at.22.42.20.mp4