early return in isPayer function when policy does not exits in workspace chat#78421
Conversation
Codecov Report✅ Changes either increased or maintained existing code coverage, great job!
|
rojiphil
left a comment
There was a problem hiding this comment.
@marufsharifi Thanks for PR. I have left a couple of comments for you. Please have a look. Thanks.
|
@rojiphil, I've applied your feedback. Please check again when you get a chance. thanks |
trjExpensify
left a comment
There was a problem hiding this comment.
I agree that the GBR shouldn't randomly appear for the approver on the workspace chat of a submitter when they leave the workspace. That said, I'm a bit confused why they seemingly have retained access to the workspace chat at all after leaving the workspace?
Aren't they replaced in the approval chain at the point of taking that action to leave, and thus would not still have access to the workspace chat?
|
@trjExpensify, I think that after leaving the workspace, he should still be able to view the expenses he previously approved, even though he’s no longer a member of the workspace. But after he leaves the workspace, he still has access to the chat to only view expenses, but is no longer wokspace member.
|
|
Mhm, as an approver, I thought your access to the policyExpenseChat is revoked with the approval chain update, which is what would happen when you leave a collect workspace and the workspace owner becomes the default approver instead. |
|
@trjExpensify, thanks. That behavior is exactly what’s happening. However, he still retains access to review the expenses in the chat. Could you please let me know if any additional changes are needed from my side? Thanks!
|
|
Nah, I think there's a bug with the approver leaving a workspace. They should lose access to the workspace chats (apart from their own, which is archived). In this video, you can see two scenarios:
2026-01-07_19-16-33.mp4So I think that's the real fix here, tbh. The workspace chat shouldn't be showing at all in the LHN after the approver leaves the workspace as they should be removed from it. |
|
@rojiphil, I updated the pr to remove all workspace chats other than the user's own workspace chat. It's working in offline mode. Let's make BE changes. Then I will continue creating new records for every platform. Thanks for your patience. Screen.Recording.1404-11-02.at.10.37.27.AM.mov |
@trjExpensify Is the test video aligned with your expectation? LGTM though. 78421-web-chrome-001.mp4 |
@marufsharifi Does this work for you when online? |
@rojiphil, it get remove immeditely, but after refreshing the page, those get's back. This needs to be removed from BE as well. |
Reviewer Checklist
Screenshots/VideosAndroid: HybridApp78421-android-hybrid-001.mp4Android: mWeb Chrome78421-mweb-chrome-001.mp4iOS: HybridApp78421-ios-hybrid-001.mp4iOS: mWeb Safari78421-mweb-safari-001.mp4MacOS: Chrome / Safari78421-web-chrome-001.mp4 |
|
@marufsharifi can we add a test case please to ensure that we remove all workspace chats other than the user’s own workspace chat upon leaving the workspace? |
Thanks @marufsharifi for the clarification. @mountiny There is a fix needed in BE when the user is an approver of another user’s workspace and attempts to leave the workspace. After leaving the workspace, the BE is still sending back the other user’s workspace chat as demonstrated below. Please help fix this in BE. Thanks. 78421-online-issue.mp4 |
|
@rojiphil @marufsharifi Can you please clarify the problem that has to be fixed in BE with numbered steps, ideally report it in the original issue and we can get someone to look into this |
|
Video looks good, though just to confirm, do we disappear archived chats from the LHN? That's why the user's own workspace chat disappears as well? I think we should get the BE fixed first. |
That's correct @trjExpensify. We hide archived chats from LHN but user can search and access them. |
|
@rojiphil, pr is ready for your review. thanks. |
|
@marufsharifi Please add unit test as mentioned here |
|
@rojiphil, added the test, could you please take another look? thanks. |
This is fixed now. 78421-web-chrome-011.mp4 |
rojiphil
left a comment
There was a problem hiding this comment.
Thanks @marufsharifi for the updates.
@mountiny @trjExpensify LGTM.
All yours now. Thanks.
|
🚧 @mountiny has triggered a test Expensify/App build. You can view the workflow run here. |
|
🧪🧪 Use the links below to test this adhoc build on Android, iOS, and Web. Happy testing! 🧪🧪
|
|
✋ This PR was not deployed to staging yet because QA is ongoing. It will be automatically deployed to staging after the next production release. |
|
🚀 Deployed to staging by https://github.com/mountiny in version: 9.3.24-1 🚀
|
|
🚀 Deployed to production by https://github.com/puneetlath in version: 9.3.24-3 🚀
|


Explanation of Change
Fixed Issues
$ #75329
PROPOSAL: #75329 (comment)
Tests
Precondition: Owner create workspace and invite employee and approver. Submission frequency in Workflows needs to be disabled
Offline tests
Same as Tests
QA Steps
Same as Tests
// 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
Android: Native
Screen.Recording.1404-09-11.at.3.00.18.PM.mov
Android: mWeb Chrome
Screen.Recording.1404-09-11.at.3.03.40.PM.mov
iOS: Native
Screen.Recording.1404-09-11.at.2.53.53.PM.mov
iOS: mWeb Safari
Screen.Recording.1404-09-11.at.2.57.06.PM.mov
MacOS: Chrome / Safari
Screen.Recording.1404-09-11.at.2.33.38.PM.mov