-
Notifications
You must be signed in to change notification settings - Fork 2.9k
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
[$500] [Dev] Infinite receipt loading spinner with backend dev environment #44692
Comments
Triggered auto assignment to @kadiealexander ( |
This has been labelled "Needs Reproduction". Follow the steps here: https://stackoverflowteams.com/c/expensify/questions/16989 |
Job added to Upwork: https://www.upwork.com/jobs/~014e28bd547489ae41 |
Triggered auto assignment to Contributor-plus team member for initial proposal review - @eh2077 ( |
ProposalPlease re-state the problem that we are trying to solve in this issue.
What is the root cause of that problem?
What changes do you think we should make in order to solve the problem?
const imageLoadedSuccessfully = useCallback(
(event: {nativeEvent: ImageLoadEventData}) => {
if (!onLoad) {
return;
}
// We override `onLoad`, so both web and native have the same signature
const source = event.nativeEvent.source;
if (source && typeof source === 'object') {
const {width, height} = source;
onLoad({nativeEvent: {width, height}});
} else {
// Handle the case where source is undefined or not an object
console.warn('Image source is undefined or not an object');
onLoad({nativeEvent: {width: 0, height: 0}});
}
},
[onLoad],
); What alternative solutions did you explore? (Optional) |
This might be dupe of #44566, I can also reproduce with stag/prod server, setting |
@ishpaul777 yes, it looks the same but I think for this demo, the app is not crashing which is different from the previous suggestion |
@Taiwrash Can you please elaborate on the root cause of this issue? |
YES! The main cause of the error is the improper cleaning up of the data after fetching it from the backend. Although this can also be handled by setting the right dependencies for the useEffect where data fetching is happening. In summary, the root cause is the improper way of |
@Taiwrash thanks for elaborating. Would you please update your original proposal with links to the current code causing the root problem and explain exactly what the issue is, along with your proposed solution? Please see our contributing guidelines and you can also look at proposals on other issue to get an idea of how they are written. Thanks @ishpaul777 for recommending setting USE_STRICT_MODE = false. I'll try that. |
Let's keep an eye on that one because it might have the same fix or root cause, but this feels a bit different so I'll keep it separate for now. |
Setting |
This comment was marked as outdated.
This comment was marked as outdated.
Sorry i take my words back its reproducable but Screen.Recording.2024-07-04.at.12.10.16.AM.mov |
@neil-marcellini, @kadiealexander, @eh2077 Uh oh! This issue is overdue by 2 days. Don't forget to update your issues! |
Still looking for proposals |
📣 It's been a week! Do we have any satisfactory proposals yet? Do we need to adjust the bounty for this issue? 💸 |
@neil-marcellini does this still happen for you? |
Upwork job price has been updated to $500 |
Do you have a new error when the receipt is not showing now? Kindly help with screenshot or video of the current state. I am sorry i have been out on this issue before now |
I figured out the error is due to the failure to receive const {width, height} = event.nativeEvent.source; Here is a quick hack I came up to fix the issue for nowconst imageLoadedSuccessfully = useCallback(
(event: {nativeEvent: ImageLoadEventData}) => {
if (!onLoad) {
return;
}
// We override `onLoad`, so both web and native have the same signature
const source = event.nativeEvent.source;
if (source && typeof source === 'object') {
const {width, height} = source;
onLoad({nativeEvent: {width, height}});
} else {
// Handle the case where source is undefined or not an object
console.warn('Image source is undefined or not an object');
onLoad({nativeEvent: {width: 0, height: 0}});
}
},
[onLoad],
);
|
@Taiwrash Thanks for sharing your findings. Can you please update your proposal based on suggestion here #44692 (comment) |
Proposal |
@neil-marcellini @eh2077 looking forward to your review and besides i haven't been added to the slack channel, all the links i am seeing are not working for me. they are requesting for a unique email address |
Why does this keep images loading? |
Those are my observations @eh2077 |
ProposalPlease re-state the problem that we are trying to solve in this issue.The receipt is infinitely loading in dev mode. In my machine it's the behavior is different from what I see in the evidence video: the image doesn't load at all. However, I believe all share the same root cause. What is the root cause of that problem?When enabling Strict Mode, React 18 simulates unmounting/mounting the component. Read more here. However, it seems like it doesn't re-create the ref during that During the This also explains if we disable the strict mode, as there's no What changes do you think we should make in order to solve the problem?The idea is that if the request got cancelled during In here, introduce
By default, in here,
And in here, we should allow the
What alternative solutions did you explore? (Optional)N/A |
@dominictb Thank you for sharing your investigation! |
@neil-marcellini I think we should put this on hold for #44566 as they're very likely to share the same root cause.
Now it solved the problem if |
This can be take off hold now. |
There're some recent updates on @dominictb Would you like to take a look into this? |
📣 It's been a week! Do we have any satisfactory proposals yet? Do we need to adjust the bounty for this issue? 💸 |
@eh2077 I think we can close this issue. That patch itself fix this problem as well. Thanks! |
If you haven’t already, check out our contributing guidelines for onboarding and email contributors@expensify.com to request to join our Slack channel!
Version Number:
Reproducible in staging?: Needs reproduction
Reproducible in production?: Needs reproduction
If this was caught during regression testing, add the test name, ID and link from TestRail:
Email or phone of affected tester (no customers):
Logs: https://stackoverflow.com/c/expensify/questions/4856
Expensify/Expensify Issue URL:
Issue reported by: @neil-marcellini
Slack conversation: https://expensify.slack.com/archives/C049HHMV9SM/p1719847597306219
Please dm @neil-marcellini on Slack during PDT hours if you would like to test against my dev env.
Action Performed:
Expected Result:
Once the receipt is loaded there won't be a loading spinner
Actual Result:
Once the receipt is loaded there won't be a loading spinner
Workaround:
Unknown
Platforms:
Which of our officially supported platforms is this issue occurring on?
Screenshots/Videos
Screen.Recording.2024-07-01.at.8.21.57.AM.mov
Add any screenshot/video evidence
View all open jobs on GitHub
Upwork Automation - Do Not Edit
The text was updated successfully, but these errors were encountered: