[CP staging] Fix Mark as paid button not showing for IOU receiver#82016
Merged
Conversation
The workspace membership check added in #81303 to prevent the Pay button from showing after a user leaves a workspace was too broad. It blocked all reports with a policyID, including IOU reports (personal 1:1 expenses) that inherit a policyID from the chat report. The receiver of such an IOU may not have access to the sender's workspace policy, causing isPayer to incorrectly return false. Skip the workspace membership check for IOU reports since they are personal expenses where the payer should always be able to pay if they are the manager, regardless of workspace membership. Co-authored-by: Cursor <cursoragent@cursor.com>
Contributor
|
If this requires C+ review and testing, I can help. |
Contributor
Reviewer Checklist
Screenshots/VideosAndroid: HybridAppAndroid: mWeb ChromeiOS: HybridAppiOS: mWeb SafariMacOS: Chrome / SafariBefore fix: Screen.Recording.2026-02-11.at.1.16.22.AM.movAfter fix: Screen.Recording.2026-02-11.at.1.18.39.AM.mov |
OSBotify
pushed a commit
that referenced
this pull request
Feb 10, 2026
[CP staging] Fix Mark as paid button not showing for IOU receiver (cherry picked from commit e9911f5) (cherry-picked to staging by lakchote)
Contributor
|
✋ This PR was not deployed to staging yet because QA is ongoing. It will be automatically deployed to staging after the next production release. |
Contributor
|
🚀 Cherry-picked to staging by https://github.com/lakchote in version: 9.3.16-9 🚀
|
Contributor
|
🚀 Deployed to production by https://github.com/lakchote in version: 9.3.16-9 🚀
|
Contributor
|
🚀 Cherry-picked to staging by https://github.com/lakchote in version: 9.3.17-0 🚀
|
Contributor
|
🚀 Deployed to production by https://github.com/lakchote in version: 9.3.17-9 🚀
|
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Add this suggestion to a batch that can be applied as a single commit.This suggestion is invalid because no changes were made to the code.Suggestions cannot be applied while the pull request is closed.Suggestions cannot be applied while viewing a subset of changes.Only one suggestion per line can be applied in a batch.Add this suggestion to a batch that can be applied as a single commit.Applying suggestions on deleted lines is not supported.You must change the existing code in this line in order to create a valid suggestion.Outdated suggestions cannot be applied.This suggestion has been applied or marked resolved.Suggestions cannot be applied from pending reviews.Suggestions cannot be applied on multi-line comments.Suggestions cannot be applied while the pull request is queued to merge.Suggestion cannot be applied right now. Please check back later.
Explanation of Change
PR #81303 added a workspace membership check in the
isPayer()function to prevent the Pay button from showing after a user leaves a workspace. However, this check was too broad — it applied to ALL reports with apolicyID, including IOU reports (personal 1:1 expenses).IOU reports can inherit a
policyIDfrom the chat report, but the receiver/payer of the IOU may not be a member of that workspace. The new check incorrectly returnedfalsefor these users, hiding the "Mark as paid" button.Root cause: In
isPayer(), the conditioniouReport?.policyID && iouReport.policyID !== CONST.POLICY.ID_FAKEmatched IOU reports that inherited a workspace policyID. When the receiver didn't have access to that policy,!policywas true andisPayerreturned false.Fix: Skip the workspace membership check for IOU reports (
!isIOUReport(iouReport)) since they are personal expenses where the payer should always be able to pay if they are the manager, regardless of workspace membership.Fixed Issues
$ #81955
Tests
2026-02-10_09-28-29.mp4
Offline tests
N/A
QA Steps
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
Changes are platform independent. See video above.
Android: Native
Android: mWeb Chrome
iOS: Native
iOS: mWeb Safari
MacOS: Chrome / Safari