Repository navigation
Only update parent chat errors for changed reports in reportAttributes - #106676
Conversation
Codecov Report✅ Changes either increased or maintained existing code coverage, great job!
|
Codex Review Summary: ✅ CompletedThis comment shows the latest Codex review activity on this pull request.
ℹ️ About Codex in GitHubYour team has set up Codex to review pull requests in this repo. Reviews are triggered when you
Codex reacts with 👀 while any review is running, comments if it has suggestions, and reacts with 👍 once all reviews finish with no findings. |
roryabraham
left a comment
There was a problem hiding this comment.
Overall this looks great. No blockers. One other thing I was wondering as I was reviewing this is: could we accomplish the same thing with simpler code by just using our memoize utility rather than an explicit cache?
memoize keeps every old copy of the chat's actions in its cache, WeakMap lets them go once they change |
roryabraham
left a comment
There was a problem hiding this comment.
Nice simplification since my previous review 👍🏼
dylanexpensify
left a comment
There was a problem hiding this comment.
Product input not required for this PR.
Reviewer Checklist
Screenshots/VideosAndroid: HybridAppPR-106676-Android.mp4Android: mWeb ChromeiOS: HybridAppPR-106676-iOS.moviOS: mWeb SafariMacOS: Chrome / SafariPR-106676-chrome.mov |
|
@twilight2294 Could a settled expense report that still has an error cause |
good catch, yes. while that error stays, every run goes over all reports once, same as main does today. updating! |
roryabraham
left a comment
There was a problem hiding this comment.
Great additional improvement @brunovjk !
|
🚧 roryabraham has triggered a test Expensify/App build. You can view the workflow run here. |
|
✋ This PR was not deployed to staging yet because QA is ongoing. It will be automatically deployed to staging after the next production release. |
|
🧪🧪 Use the links below to test this adhoc build on Android, iOS, and Web. Happy testing! 🧪🧪
|
|
🚀 Deployed to staging by https://github.com/roryabraham in version: 9.5.40-0 🚀
|
|
No help site update needed — this PR optimizes chat error processing and makes an edge-case target selection deterministic, without adding a user workflow or making existing article instructions incorrect. |
|
🚀 Deployed to production by https://github.com/marcaaron in version: 9.5.40-1 🚀
Bundle Size Analysis (Sentry): |
Explanation of Change
reportAttributesrebuilt the parent chat errors from every report on every compute, and searched all of a workspace chat's actions once per expense report with an error, so one changed DM got slower the more reports an account had. Now it only updates that list for the reports recomputed in the run, and indexes a chat's preview actions once, reusing the index until the chat's actions change. When two preview actions have the samecreated, the Fix button now picks the lowerreportActionID.On 20k reports one changed DM goes from 140.6ms to 9.0ms (
tests/perf-local/ReportAttributes.perf-local.ts).Fixed Issues
$ #106760
PROPOSAL: #106760
Tests
Offline tests
Same as tests, with the app offline for step 6, then go back online and verify the LHN updates.
QA Steps
// TODO: These must be filled out, or the issue title must include "[No QA]."
Same as tests
PR Author Checklist
### Fixed Issuessection aboveTestssectionOffline stepssectionQA stepssectionAvatar, I verified the components usingAvatarare working as expected)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.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
1-Android-Native.mp4
Android: mWeb Chrome
2-Android-mWeb-Chrome.mp4
iOS: Native
3-iOS-Native.mp4
iOS: mWeb Safari
4-iOS-mWeb-Safari.mp4
MacOS: Chrome / Safari
5-MacOS-Chrome.mp4