Skip to content

Conversation

@matejminar
Copy link
Member

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).

@matejminar matejminar requested review from a team October 22, 2021 10:39
@matejminar
Copy link
Member Author

@wmak @Zylphrex I know we talked about this before, finally managed to get to it 👍

end,
organization.slug,
location.query.project,
location.query.environment,
Copy link
Member

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?

Copy link
Member Author

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>) {
Copy link
Member

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"?

Copy link
Member Author

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.

Copy link
Member

@priscilawebdev priscilawebdev left a 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

@matejminar matejminar merged commit 5f1497c into master Oct 25, 2021
@matejminar matejminar deleted the feat/release-details-refetching branch October 25, 2021 09:30
@github-actions github-actions bot locked and limited conversation to collaborators Nov 9, 2021
Sign up for free to subscribe to this conversation on GitHub. Already have an account? Sign in.

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

4 participants