-
Notifications
You must be signed in to change notification settings - Fork 3.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
fix(dashboard): Fix stale data on test workflow page #7245
fix(dashboard): Fix stale data on test workflow page #7245
Conversation
ecb497a
to
d437c11
Compare
✅ Deploy Preview for dev-web-novu ready!
To edit notification comments on pull requests, go to your Netlify site configuration. |
✅ Deploy Preview for dashboard-v2-novu-staging ready!
To edit notification comments on pull requests, go to your Netlify site configuration. |
d437c11
to
5b19e17
Compare
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 approved it but please see my comment about caching.
queryKey: [ | ||
QueryKeys.fetchWorkflowTestData, | ||
currentEnvironment?._id, | ||
getEncodedId({ slug: workflowSlug, divider: WORKFLOW_DIVIDER }), |
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.
Nit-picky one:
getEncodedId({ slug: workflowSlug, divider: WORKFLOW_DIVIDER }), | |
getWorkflowInternalId(workflowSlug), |
const { currentEnvironment } = useEnvironment(); | ||
const { data, isPending, error } = useQuery<WorkflowTestDataResponseDto>({ | ||
queryKey: [QueryKeys.fetchWorkflowTestData, currentEnvironment?._id, workflowSlug], | ||
queryKey: [ |
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.
@desiprisg I think the test data page is better if we don't cache it at all. It's a separate tab, so I don't see the value of caching. We'd rather fetch data every time we visit the tab instead of caching and invalidating.
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.
Sure we can set gcTime
to 0 to achieve this. queryKey
remains required though, in order to trigger a refetch if an invalidation were to happen while the query is still used.
5b19e17
to
731e1a0
Compare
731e1a0
to
d153eac
Compare
d153eac
to
143fb81
Compare
What changed? Why was the change needed?
Screenshots
Expand for optional sections
Related enterprise PR
Special notes for your reviewer