-
Notifications
You must be signed in to change notification settings - Fork 144
Apply smart refetchInterval
to all resource tables
#7216
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
base: main
Are you sure you want to change the base?
Conversation
refetchIntervalInBackground
to all resource tablesrefetchIntervalInBackground
to all resource tables
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.
However, for dashboards, reports, and alerts tables, this approach isn't required
For dashboards especially, we would like to poll the ListResources
API when the resource has not finished reconciling. This will particularly help the UX when deploying projects (see my comment in the setup.ts
file).
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.
Rather than repeating the refetch function across each resource file, can we put it in one central location? Maybe features/projects
would be the right directory?
Additionally, mind updating the PR description? |
refetchIntervalInBackground
to all resource tablesrefetchInterval
to all resource tables
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.
refetchInterval
to all resource tablesrefetchInterval
to all resource tables
refetchInterval
to all resource tablesrefetchInterval
to all resource tables
0bc973f
to
c00c0a6
Compare
7c10177
to
6671e12
Compare
select: (data) => { | ||
updateSmartRefetchInterval(data?.resources); | ||
return data; | ||
}, | ||
refetchInterval: () => get(refetchInterval), |
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.
It'd be better if the refetch interval logic were all encapsulated in the refetchInterval
parameter. It's not very clean to add (half of) the refetch logic as a side effect to the select
function.
// Store for the current refetch interval | ||
export const refetchInterval = writable<number | false>( | ||
INITIAL_REFETCH_INTERVAL, | ||
); |
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 one global store will work. This prohibits us from having two queries on the same page that use the smart refetch logic. For example, both the ProjectGlobalStatusIndicator
and e.g. the DashboardsTable
components are mounted at the same time and should use the smart refetch logic for their respective queries.
Can you please try the query.meta
approach?
Per the docs, the meta
field is intended for user-defined state. Yes, it's usually static state, but dynamic state might still work.
refetchInterval
to all resource tablesrefetchInterval
to all resource tables
@lovincyrus : Any updates on this PR ? Whats next here? |
@lovincyrus, checking in on this PR, have you given any thought to these two comments? ![]() |
Ah, I responded in another thread #7216 (comment) We can certainly reconsider them |
I plan to revisit this after completing the data connector UX sprints. |
This reverts commit 8a756a1.
1859503
to
029759c
Compare
Closes #6667
In this pull request, we introduced a custom refetch interval to repeatedly reload a resource until its status was marked as complete. That same custom refetch interval is being applied to dashboards, alerts, and reports.
Checklist: