-
-
Notifications
You must be signed in to change notification settings - Fork 4.5k
feat(ui): Reduce the number of re-fetches on release details #29507
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
Conversation
| end, | ||
| organization.slug, | ||
| location.query.project, | ||
| location.query.environment, |
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.
If I recall, environment here can be an array. And in that scenario, this useEffect will always re-run whenever the location changes since it will fail the Object.is check right?
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.
ah, good catch!
| }; | ||
| } | ||
|
|
||
| componentDidUpdate(prevProps, prevContext: Record<string, any>) { |
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.
wouldn't the second parameter be "prevState"?
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.
yeah, I think the confusion comes from this line:
| componentDidUpdate(prevProps: P, prevContext: any) { |
We have it named like this in a couple of different places, can open a follow-up PR to rename it everywhere.
priscilawebdev
left a comment
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.
code looks good to me
I added a couple of conditions to release details requests so that they re-fetch only when it's truly needed.
No need to call releases endpoint again if only the issues/transactions/chart filter changed (same for a couple of other endpoints).