fix: Prevent self approval still display in expense detail after set approver for workspace#84700
Conversation
…approver for workspace
Codecov Report✅ Changes either increased or maintained existing code coverage, great job!
|
|
Great work @nkdengineer, however initially the message Full testScreen.Recording.2026-03-10.at.10.56.25.movJust the flickering part.qwer.movDo you think this is related to the changes in BE that you mentioned here? Thanks. |
@brunovjk Yes, this is the backend problem I mentioned. |
joekaufmanexpensify
left a comment
There was a problem hiding this comment.
Good for product
|
@luacmartins can you help me check and fix the issue mentioned by nkdengineer here? Thank you very much. |
|
@nkdengineer from the video, it seems like the BE has the correct value for the nextStep since the correct value is shown after the report loads. Are we sure this is an issue with the BE and we're not just a missing optimistic update in App? |
|
|
@nkdengineer I checked the response of |
@luacmartins I mean here is the |
Also, I don't think it's a good idea because we need to go through all related expense reports and calculate the next step. |
|
Well, yes but that'd ensure the functionality is correct offline, right? |
|
Yes. |
If it's expected that the backend will change the report's next step when enabling/disabling prevent self-approval, we need to do that in |
|
@nkdengineer that seems correct |
Fixed this issue
@brunovjk Can't reproduce |
|
@nkdengineer is this ready for review again? |
|
Yes it's ready |
|
@brunovjk could you please review? |
|
@nkdengineer I can still reproduce the bug where the old message briefly appears, but only for new users, after the message "disappears" for the first time, the bug is no longer reproducible. The "Submit" button was also disabled within the expense preview. The bug where the create expense modal gets stuck is not related to this PR; the bug is also reproducible in main. Screen.Recording.2026-04-15.at.09.55.44.movCan you reproduce this? Thank you. |
|
@luacmartins @brunovjk Again, we have another case here where the |
|
@dangrous tagging you since I believe you worked on the next step changes. What do you think of the comment above? |
|
I think for the moment at least we will still need to calculate that in the backend, since we expect it in Old Dot. I don't believe we currently recalculate any next steps - or send Onyx updates - based on policy changes, because it would require us to check all reports on the policy. This will eventually be a feature of the new next steps once they're fully migrated into Auth, but we're not there yet. Right now they're only recalculated when a report is newly (re)opened I guess we could potentially calculate the prevent-self-approval on BOTH front ends, if that would clean up something in App, but not sure if that's necessarily worth the effort? |
|
@nkdengineer did you get a chance to review the comment above? |
@luacmartins Based on this, since we don't recalculate the next step on the policy changes and it's calculated in the read time, can we skip this issue instead of trying to update the optimistic next step of all reports on the policy changes since it's waiting for the update from the backend site, it's not something wrong in the frontend
We already calculated the prevent-self approval in the front-end here. Lines 357 to 390 in 666d9c0 |
|
@nkdengineer yea that seems fine |
Reviewer Checklist
Screenshots/VideosAndroid: HybridApp84700_android_web.movAndroid: mWeb Chrome84700_android_web.moviOS: HybridApp84700_ios_native.moviOS: mWeb Safari84700_ios_web.movMacOS: Chrome / Safari84700_web_chrome.mov |
brunovjk
left a comment
There was a problem hiding this comment.
LGMT. Thanks for the hard work here @nkdengineer and @luacmartins.
|
🚧 @luacmartins 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/luacmartins in version: 9.3.65-0 🚀
Bundle Size Analysis (Sentry): |
|
I reviewed the changes in this PR against the help site files under No help site changes are required. This PR is a bug fix that corrects when the "prevent self-approval" block is applied — it now properly considers report state (open vs processing) and unblocks submission when a different approver has been set. The existing docs already describe the feature correctly at the right level of abstraction:
The fix makes the code match the already-documented behavior, so no documentation updates are needed. |
|
🚀 Deployed to production by https://github.com/mountiny in version: 9.3.65-6 🚀
|
Explanation of Change
fix: Prevent self approval still display in expense detail after set approver for workspace
Fixed Issues
$ #80255
PROPOSAL: #80255 (comment)
Tests
Precondition: Create a control workspace, at workflows set Submission manually, enable Prevent self-approvals
Offline tests
QA Steps
Same as test
PR Author Checklist
### Fixed Issuessection aboveTestssectionOffline stepssectionQA stepssectiontoggleReportand 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-03-10.at.15.52.37.mov
Android: mWeb Chrome
Screen.Recording.2026-03-10.at.15.52.02.mov
iOS: Native
Screen.Recording.2026-03-10.at.15.51.10.mov
iOS: mWeb Safari
Screen.Recording.2026-03-10.at.15.50.43.mov
MacOS: Chrome / Safari
Screen.Recording.2026-03-10.at.15.48.40.mp4