Feat: Improve isLoading to prevent loading for undefined#51360
Conversation
Reviewer Checklist
Screenshots/VideosAndroid: NativeScreen.Recording.2024-11-11.at.6.07.56.in.the.morning.movAndroid: mWeb ChromeScreen.Recording.2024-11-11.at.5.43.52.at.night.moviOS: NativeScreen.Recording.2024-11-11.at.6.11.22.in.the.morning.moviOS: mWeb SafariScreen.Recording.2024-11-11.at.5.52.55.at.night.movMacOS: Chrome / SafariScreen.Recording.2024-10-25.at.7.17.58.in.the.evening.movMacOS: DesktopScreen.Recording.2024-11-11.at.6.18.04.in.the.morning.mov |
|
There is loading indicator when opening the page on a fresh sign in, is this expected? @waterim @joekaufmanexpensify? Screen.Recording.2024-10-25.at.7.22.21.in.the.evening.mov |
On the Expensify Card page you mean? |
|
Yes
…On Fri, 25 Oct 2024 at 7:35 PM Joseph Kaufman ***@***.***> wrote:
There is loading indicator when opening the page on a fresh sign in, is
this expected?
On the Expensify Card page you mean?
—
Reply to this email directly, view it on GitHub
<#51360 (comment)>, or
unsubscribe
<https://github.com/notifications/unsubscribe-auth/AR4OEVYBYMGIVLELQODWBOLZ5JXMHAVCNFSM6AAAAABQPQHBT6VHI2DSMVQWIX3LMV43OSLTON2WKQ3PNVWWK3TUHMZDIMZYGI4DAMZQGA>
.
You are receiving this because you were mentioned.Message ID:
***@***.***>
|
|
@waterim could we easily clean that up here too? |
|
@joekaufmanexpensify Sorry, missed this comment, sure, will update today |
|
All good. And sounds great. TY! |
|
@joekaufmanexpensify Issue is a bit weird as this loading is an issue with some onyx update, On an initial loading all useOnyx hooks are returning an undefined for a moment and a correct data after meanwhile in companyCards everything works correctly and data is coming from onyx as it should be |
|
Got it. Is it easy to fix that? |
|
@joekaufmanexpensify Cant understand why its happening, we dont have any resets, but it still shows undefined for some reason, still researching |
|
@joekaufmanexpensify But for expensifyCards both cardSettings and cardList are not initialized in other places and thats why for the initial render it shows loading inidicator for a moment while it getting data from onyx store as useOnyx has 'isLoading' inidicator during that time. Im not sure do we need to fix it to be honest, as its an expected behaviour from useOnyx, but 2 solutions exists:
Let me know your thoughts on this please |
|
Is one of those solutions viable? The loading indicator does look kind of odd. If we can fix this without much effort, that would be solid IMO. |
|
@joekaufmanexpensify it will be hacky or with using a deprecated withOnyx, only these 2 solutions I can see here |
|
@joekaufmanexpensify @getusha Updated |
Mind clarifying a bit more about what this solution means? I'm not sure I understand |
|
@joekaufmanexpensify loading happens because data we use from useOnyx is not persisted and it means we need to wait for an initial data fetching from the store, but if we use useOnyx for the same keys somewhere else in the app (parent views) For ExpensifyCards we didnt brickRoadIndicator and I added verifications for errors in WorkspaceInitialPage as we have for other screens (it means both cardList and cardSettings which we are using for Expensify page will be fetched before and with using once again same onyx keys we will not have "undefined" for an initial load) |
|
We did not find an internal engineer to review this PR, trying to assign a random engineer to #51333 as well as to this PR... Please reach out for help on Slack if no one gets assigned! |
|
✋ 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/rlinoz in version: 9.0.60-0 🚀
|
|
|
||
| const isLoading = !cardFeeds || !!(cardFeeds.isLoading && !cardFeeds.settings); | ||
| const companyCards = CardUtils.removeExpensifyCardFromCompanyCards(cardFeeds?.settings?.companyCards); | ||
| const isLoading = !cardFeeds || !!(cardFeeds.isLoading && !companyCards); |
There was a problem hiding this comment.
We want only initial loading for a smooth work
There was a problem hiding this comment.
But it looks like !companyCards will never be true
There was a problem hiding this comment.
I think you are right, lets try to fix this in a next PR
|
🚀 Deployed to production by https://github.com/francoisl in version: 9.0.60-3 🚀
|
Details
Fixed Issues
$ #51333
PROPOSAL: N/A
Tests
Offline tests
Same as tests
QA Steps
None
PR Author Checklist
### Fixed Issuessection aboveTestssectionOffline stepssectionQA stepssectiontoggleReportand notonIconClick)myBool && <MyComponent />.src/languages/*files and using the translation methodWaiting for Copylabel for a copy review on the original GH to get the correct copy.STYLE.md) were followedAvatar, I verified the components usingAvatarare working as expected)/** comment above it */thisproperly so there are no scoping issues (i.e. foronClick={this.submit}the methodthis.submitshould be bound tothisin the constructor)thisare necessary to be bound (i.e. avoidthis.submit = this.submit.bind(this);ifthis.submitis never passed to a component event handler likeonClick)StyleUtils.getBackgroundAndBorderStyle(themeColors.componentBG))Avataris modified, I verified thatAvataris working as expected in all cases)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
Details
Screen.Recording.2024-10-23.at.21.15.36.mov