Fix: update options when creating task#39811
Conversation
…when-creating-task
|
@thesahindia 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] |
|
@thesahindia 👋 what is your ETA for this pr please? thanks! |
Reviewer Checklist
Screenshots/VideosAndroid: NativeScreen.Recording.2024-04-10.at.2.08.02.AM.movAndroid: mWeb ChromeScreen.Recording.2024-04-10.at.1.59.51.AM.moviOS: NativeScreen.Recording.2024-04-10.at.2.30.24.AM.moviOS: mWeb SafariScreen.Recording.2024-04-10.at.2.25.32.AM.movMacOS: Chrome / SafariScreen.Recording.2024-04-10.at.1.55.27.AM.movMacOS: DesktopScreen.Recording.2024-04-10.at.2.15.55.AM.mov |
| const report = reports[missingReportId]; | ||
|
|
||
| if (!report) { | ||
| return; | ||
| } |
There was a problem hiding this comment.
isnt this already captured in the condition above?
| // eslint-disable-next-line react-hooks/exhaustive-deps | ||
| }, [reports]); | ||
|
|
||
| useEffect(() => { |
There was a problem hiding this comment.
@TMisiukiewicz can you please add some comment here to explain what this is good for?
There was a problem hiding this comment.
added comments to each effect for easier understanding 👍
mountiny
left a comment
There was a problem hiding this comment.
One comment but not a blocker
| const missingReportId = Object.keys(reports).find((key) => prevReports && !(key in prevReports)); | ||
| const report = missingReportId ? reports[missingReportId] : null; | ||
| if (!missingReportId || !report) { |
There was a problem hiding this comment.
What if we merge collection of reports so there would be more reports missing in that single update, can that happen? @TMisiukiewicz
There was a problem hiding this comment.
@mountiny that's a valid point, however I couldn't find a quick way how could I test it with many reports, are you aware of any way how to do that? Are merge calls batched? If so, I assume there could be more than just a single ID missing. I can create a follow-up PR moving from find to filter
|
✋ 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: 1.4.63-0 🚀
|
|
🚀 Deployed to production by https://github.com/mountiny in version: 1.4.63-21 🚀
|
Details
If the task was created, it did not appear on the search list. There was no mechanism responsible for creating new option and putting it in the option list for newly created reports. This solution should be performant, since it looks for the report key that did not exist in the past, creates a single option and updates the report options.
Fixed Issues
$ #39705
PROPOSAL:
Tests
Offline tests
n/a
QA Steps
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.mp4
Android: mWeb Chrome
ANDROID.WEB.mov
iOS: Native
IOS.mp4
iOS: mWeb Safari
IOS.WEB.mp4
MacOS: Chrome / Safari
WEB.mov
MacOS: Desktop
DESKTOP.mov