Hi all,

Any viewer can pick any auto-refresh interval on any dashboard, Custom
included. On an expensive database, short intervals across many open
sessions add up to a steady query load, and dashboard editors have no way
to limit it.

#46037 <https://github.com/apache/superset/pull/46037> adds an optional
auto-refresh policy per dashboard, behind a new flag, AUTO_REFRESH_POLICY,
off by default.

https://github.com/apache/superset/pull/46037

An editor can turn auto-refresh off for a dashboard, or set a shortest and
longest interval. Viewers then see only the allowed intervals, embedded
dashboards included. Manual refresh stays.

With the flag off, a stored policy is kept but ignored, and dashboards
behave as today. No migration, no new permission, no new dependency.

Design choices:
- Editors set the policy, not operators. DASHBOARD_AUTO_REFRESH_INTERVALS
stays the outer limit: bounds must come from that list.
- The policy lives in json_metadata.auto_refresh_policy, with bounds in
whole seconds like refresh_frequency.
- With a policy, viewers can't pick a Custom interval.
- Writes (API, copy, import, MCP, version restore) refuse invalid settings
with field errors. Nothing is clamped silently.
- Refresh rules are checked only when the policy or frequency changes, so
unrelated saves like a title change keep working.
- An omitted key keeps the stored policy; null removes it. Changes are
logged in the existing Log table.

If there are no objections by Monday, December 1, I'll consider this
approved by lazy consensus and continue with the review on the PR. Happy to
answer questions here or on the PR.

Thanks,
Damian Pendrak

Reply via email to