Fix LHN report badge reactivity to policy field changes#85523
Conversation
|
@mjasikowski 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] |
|
@sosek108 can you add automated tests for hasPolicyRelevantFieldChanged and subsequently any code flows that rely on this? |
|
If this requires C+ review, I can help as I have context |
|
No product review needed |
@mjasikowski done, I've created tests for this function |
Reviewer Checklist
Screenshots/VideosAndroid: HybridAppAndroid: mWeb ChromeiOS: HybridAppiOS: mWeb SafariMacOS: Chrome / SafariMacOS: Desktop |
|
@mjasikowski are you able to merge this? |
|
cc: @NikkiWines |
|
🚧 @NikkiWines 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/NikkiWines in version: 9.3.42-0 🚀
Bundle Size Analysis (Sentry): |
Explanation of Change
When a workspace admin updates a policy setting (e.g. approval mode, reimbursement choice, auto-reimbursement limit), the LHN action badges for that workspace's reports were not recomputed — they showed stale state until an unrelated event triggered the next recompute.
This fix adds a
hasPolicyRelevantFieldChangedhelper that compares only the 8 fields that actually affect report badge/name computation. When a policy update arrives after initial load, the handler identifies which policy IDs had meaningful changes, collects the affected report keys, and spreads them into the existing per-report recompute path. Reports belonging to unaffected workspaces are untouched.Fixed Issues
$ #83043
PROPOSAL:
Tests
Open application in two separate windows
Approvebadge is visiblePayOffline tests
Open application in two separate windows
Approvebadge is visiblePayQA Steps
Same as tests
Open application in two separate windows
Approvebadge is visiblePayPR 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
Nagranie.z.ekranu.2026-03-19.o.11.30.24.mov
Android: mWeb Chrome
iOS: Native
Nagranie.z.ekranu.2026-03-19.o.11.48.08.mov
Nagranie.z.ekranu.2026-03-19.o.11.59.39.mov
iOS: mWeb Safari
MacOS: Chrome / Safari
after-fix.mov