recalculate only changed options in OptionListContextProvider#60264
recalculate only changed options in OptionListContextProvider#60264dangrous merged 18 commits intoExpensify:mainfrom
Conversation
399f03b to
1a6c0b9
Compare
|
@allroundexperts 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] |
Reviewer Checklist
Screenshots/VideosAndroid: NativeUnable to build android Android: mWeb ChromeScreen.Recording.2025-04-18.at.11.44.20.PM.moviOS: NativeScreen.Recording.2025-04-19.at.12.03.07.AM.moviOS: mWeb SafariScreen.Recording.2025-04-18.at.11.37.46.PM.movMacOS: Chrome / SafariScreen.Recording.2025-04-18.at.11.19.34.PM.movMacOS: DesktopScreen.Recording.2025-04-18.at.11.35.11.PM.mov |
|
@allroundexperts Can you prioritise this one please? thanks! |
|
On it today |
|
The report autocomplete shows Screen.Recording.2025-04-18.at.11.20.50.PM.movIs this expected? |
Screen.Recording.2025-04-18.at.11.26.57.PM.movTwo bugs here.
|
Do you see this in main? I am not sure about this one so if its in main that its probably fine, if not, its probs a bug |
|
Confirmed on main. I was not able to see any of the above. @TMisiukiewicz Can you please verify? |
|
yeah I'll check it out |
|
All the reported things are reproducible on main |
|
@allroundexperts can you please verify again? |
|
@TMisiukiewicz Please resolve the conflicts. Also, the perf tests are failing? |
|
@allroundexperts should be good now |
|
@TMisiukiewicz can you please resolve the conflicts? |
|
@mountiny done ✅ |
mountiny
left a comment
There was a problem hiding this comment.
Changes look good to me, @dangrous do you want to review too?
@TMisiukiewicz @allroundexperts maybe a dumb question but is there a risk if this context is created for signed in user to see any weird issues once this is deployed and we change how the context is behaving? It is not clear to me from the code if there could be some issues or not, but wanted to raise this
|
@mountiny If i understand your concern correctly, it should not affect anyone. These context values are not stored in any persistent way. They are generated from scratch each time user opens/refreshes the app and additionally has to visit any Search page to initialize this. I think we should be safe then |
|
Sounds good, thanks for confirming. I was not sure if the context was already initialized and we do this update on web in the background, if any issue could occur. |
dangrous
left a comment
There was a problem hiding this comment.
minor typo, looks good otherwise!
|
|
||
| /** | ||
| * This effect is used to update the options list when reports change. | ||
| * This effect is responsible for generating the options list when there data is not yet initialized |
There was a problem hiding this comment.
| * This effect is responsible for generating the options list when there data is not yet initialized | |
| * This effect is responsible for generating the options list when their data is not yet initialized |
There was a problem hiding this comment.
thanks, fixed ✅
|
oh wait we've got some more |
|
@dangrous should be good now |
|
Gonna go ahead and merge this one! |
|
✋ 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/dangrous in version: 9.1.38-0 🚀
|
|
🚀 Deployed to production by https://github.com/thienlnam in version: 9.1.38-4 🚀
|
| return prevOptions; | ||
| } | ||
|
|
||
| const updatedReportsMap = new Map(prevOptions.reports.map((report) => [report.reportID, report])); |
There was a problem hiding this comment.
Coming from #74230, the report can be undefined, so we need to add the safeguard here
Explanation of Change
Currently all options are recomputed each time any report in a collection changes. This solution updates only changed reports, saving time and resources.
Fixed Issues
$ #59825
PROPOSAL:
Tests
Offline tests
n/a
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 stepssectiontoggleReportand notonIconClick)myBool && <MyComponent />.src/languages/*files and using the translation methodSTYLE.md) were followedAvatar, I verified the components usingAvatarare working as expected)StyleUtils.getBackgroundAndBorderStyle(theme.componentBG))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.mov
Android: mWeb Chrome
iOS: Native
ios.mp4
iOS: mWeb Safari
ios-web.mp4
MacOS: Chrome / Safari
web.mov
MacOS: Desktop
desktop.mov