-
-
Notifications
You must be signed in to change notification settings - Fork 4.2k
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
fix(issue-stream): Wait until stats request has finished before saving groups into cache #83073
fix(issue-stream): Wait until stats request has finished before saving groups into cache #83073
Conversation
…g groups into cache
|
||
await screen.findByRole('grid', {name: 'Create a search query'}); | ||
await userEvent.click(getSearchInput()); | ||
await userEvent.keyboard('foo{enter}'); | ||
|
||
expect( | ||
await screen.findByText(/We couldn't find any issues that matched your filters/i) |
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.
This test was actually just wrong before, these changes made it start failing because it should show "No issues match your search" instead
const {id} = data[0]; | ||
redirect = `/organizations/${organization.slug}/issues/${id}/`; | ||
} | ||
api.request(`/organizations/${organization.slug}/issues/`, { |
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.
Best to view this diff with "hide whitespace" because there are only a few actual changes here
@@ -704,14 +672,6 @@ function IssueListOverviewFc({ | |||
// reload data. | |||
if (!isEqual(previousRequestParams, requestParams)) { | |||
fetchData(selectionChanged); | |||
} else if ( |
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 don't think this is necessary anymore, it should react to the URL changing now
Suspect IssuesThis pull request was deployed and Sentry observed the following issues:
Did you find this useful? React with a 👍 or 👎 |
Fixes a bug in the refactored component where navigating to an issue and going back to the stream would never load the stats. This is because I started caching when the request completed instead of when the component unmounted, but never waited for the stats request to complete.
requestPromise
instead ofrequest
api.clear()
instead oflastRequestRef.current.cancel()