-
Notifications
You must be signed in to change notification settings - Fork 3k
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
Feat: Improve isLoading to prevent loading for undefined #51360
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 companyCards = CardUtils.removeExpensifyCardFromCompanyCards(cardFeeds?.settings?.companyCards); | ||
const isLoading = !cardFeeds || !!(cardFeeds.isLoading && !companyCards); |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
We want only initial loading for a smooth work
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
But it looks like !companyCards
will never be true
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
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 Issues
section aboveTests
sectionOffline steps
sectionQA steps
sectiontoggleReport
and notonIconClick
)myBool && <MyComponent />
.src/languages/*
files and using the translation methodWaiting for Copy
label for a copy review on the original GH to get the correct copy.STYLE.md
) were followedAvatar
, I verified the components usingAvatar
are working as expected)/** comment above it */
this
properly so there are no scoping issues (i.e. foronClick={this.submit}
the methodthis.submit
should be bound tothis
in the constructor)this
are necessary to be bound (i.e. avoidthis.submit = this.submit.bind(this);
ifthis.submit
is never passed to a component event handler likeonClick
)StyleUtils.getBackgroundAndBorderStyle(themeColors.componentBG)
)Avatar
is modified, I verified thatAvatar
is working as expected in all cases)ScrollView
component to make it scrollable when more elements are added to the page.main
branch was merged into this PR after a review, I tested again and verified the outcome was still expected according to theTest
steps.Screenshots/Videos
Screen.Recording.2024-10-23.at.21.15.36.mov