[Home page] Export widget shows for users who are not the preferred exporter#81705
Conversation
|
@ZhenjaHorbach 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] |
|
🚧 @grgia has triggered a test Expensify/App build. You can view the workflow run here. |
|
@adamgrzybowski |
This comment has been minimized.
This comment has been minimized.
joekaufmanexpensify
left a comment
There was a problem hiding this comment.
Good from product
|
@adamgrzybowski |
3d975bc to
5365f5b
Compare
Reviewer Checklist
Screenshots/VideosAndroid: HybridApp2026-03-02.15.55.13.movAndroid: mWeb Chrome2026-03-02.15.53.35.moviOS: HybridApp2026-03-02.15.55.13.moviOS: mWeb Safari2026-03-02.15.53.35.movMacOS: Chrome / Safari2026-03-02.15.15.38.mov |
| return invoiceReceiverPolicy?.role === CONST.POLICY.ROLE.ADMIN && reimbursableSpend > 0; | ||
| } | ||
|
|
||
| function isExportAction(report: Report, currentUserLogin: string, policy?: Policy, reportActions?: ReportAction[]) { |
There was a problem hiding this comment.
We use this function in a few places
Shouldn't this break anything?
There was a problem hiding this comment.
To me, these changes make sense to fix this problem. However, I may have too little domain knowledge about report dependencies to know if there was some edge case that was working before, with wrong assumptions, and now will break. It would be great summon a developer who is experienced with report utils.
There was a problem hiding this comment.
Looks like it came from this PR
https://github.com/Expensify/App/pull/74063/changes
There was a problem hiding this comment.
So I would prefer to leave this condition for other cases except our
There was a problem hiding this comment.
TBH this sounds like something we should confirm with @mountiny.
It almost feels like my PR is contradiction of the PR you just linked 😄
|
Hm frankly I don't like this change without much context or further testing. Though from the reproduction, this was a bug only on the home page but Reports were showing a correct number, right? This should use same logic and data |
|
Summoning @JmillsExpensify as an expert in exports 😄 I've tried to reproduce the bug on main, and I can't anymore. Could you please confirm the steps I executed? If it was fixed by someone, I think we can ditch this PR Steps to reproduce:
On video, I additionally checked if the export state for reports matches the home page. It does BTW Isn't the export difference between accounts weird? Is it a bug or a feature? Screen.Recording.2026-02-13.at.11.29.03.mov |
|
In any case, steps to reproduce:
Result: Admin a is still prompted with the export todo, even though the preferred exporter is now admin B. |
|
@JmillsExpensify Yeah, I used the test workspace from you. I will re-test that. Thanks! |
|
@JmillsExpensify, I'm still having problems reproducing this issue. I reached out to you in the slack so we can figure out what is the difference between our setups easier. |
5365f5b to
4a072ba
Compare
|
After cleaning the browser memory related to Expensify and merging the newest main, I was able to reproduce the problem once again. @ZhenjaHorbach I did a step back, having your comment in mind. I explored the flow more and came up with an alternative solution that should be safer. I also updated the PR description with the new approach. Could you please take a look? |
|
Hi @ZhenjaHorbach, could you please re-review? Thanks 🙇 |
Oh |
|
Looks like the fix works good! |
|
Summoning @mountiny so we can finally close this one 🙏 |
|
🚧 @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.31-0 🚀
|
|
🚀 Deployed to production by https://github.com/blimpich in version: 9.3.31-12 🚀
|

Explanation of Change
isExportActionintentionally allows any workspace admin to see the Export action on individual reports (added in #74063). However, this same function is reused intodos.tsto compute the Export count for the Home page widget and Reports tab sidebar, causing admins who are not the preferred exporter to see an inflated count.Rather than removing the admin fallback from
isExportAction(which would regress #72517), this PR adds anisPreferredExportercheck at the call site intodos.tsso the todos count only includes reports where the current user is the configured exporter.Fixed Issues
$ #81228
PROPOSAL:
Tests
Offline tests
QA Steps
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
Android: mWeb Chrome
iOS: Native
iOS: mWeb Safari
MacOS: Chrome / Safari
Screen.Recording.2026-02-06.at.12.20.37.mov