Skip to content

fix(Tabs): prevent infinite rerenders with nested tabs#37018

Merged
msyavuz merged 4 commits into
masterfrom
msyavuz/fix/infinite-refresh-bug
Jan 10, 2026
Merged

fix(Tabs): prevent infinite rerenders with nested tabs#37018
msyavuz merged 4 commits into
masterfrom
msyavuz/fix/infinite-refresh-bug

Conversation

@msyavuz
Copy link
Copy Markdown
Member

@msyavuz msyavuz commented Jan 9, 2026

SUMMARY

#35265 introduced a bug where refreshing a dashboard with nested tabs would cause infinite rerenders. This pr fixes that bug by introducing a lazy option to dashboard refresh action that doesn't update the global refresh time.

BEFORE/AFTER SCREENSHOTS OR ANIMATED GIF

Before:

tab-refresh-before.mp4

After:

tab-refresh-after.mp4

TESTING INSTRUCTIONS

  1. Create a dashboard with nested tabs.
  2. Refresh it using Refresh dashboard button on three-dot menu.

This should not cause infinite rerenders.

ADDITIONAL INFORMATION

  • Has associated issue:
  • Required feature flags:
  • Changes UI
  • Includes DB Migration (follow approval process in SIP-59)
    • Migration is atomic, supports rollback & is backwards-compatible
    • Confirm DB migration upgrade and downgrade tested
    • Runtime estimates and downtime expectations provided
  • Introduces new feature or API
  • Removes existing feature or API

@netlify
Copy link
Copy Markdown

netlify Bot commented Jan 9, 2026

Deploy Preview for superset-docs-preview ready!

Name Link
🔨 Latest commit 45bb64d
🔍 Latest deploy log https://app.netlify.com/projects/superset-docs-preview/deploys/696147da56df590008bfd387
😎 Deploy Preview https://deploy-preview-37018--superset-docs-preview.netlify.app
📱 Preview on mobile
Toggle QR Code...

QR Code

Use your smartphone camera to open QR code link.

To edit notification comments on pull requests, go to your Netlify project configuration.

@msyavuz msyavuz marked this pull request as ready for review January 9, 2026 18:28
@dosubot dosubot Bot added the dashboard:tab Related to the usage of tabs in the Dashboard label Jan 9, 2026
@sadpandajoe sadpandajoe added the 🎪 ⚡ showtime-trigger-start Create new ephemeral environment for this PR label Jan 9, 2026
@github-actions github-actions Bot added 🎪 45bb64d 🚦 building 🎪 ⌛ 48h Environment expires after 48 hours (default) and removed 🎪 ⚡ showtime-trigger-start Create new ephemeral environment for this PR labels Jan 9, 2026
@github-actions
Copy link
Copy Markdown
Contributor

github-actions Bot commented Jan 9, 2026

🎪 Showtime is building environment on GHA for 45bb64d

@github-actions
Copy link
Copy Markdown
Contributor

github-actions Bot commented Jan 9, 2026

🎪 Showtime deployed environment on GHA for 45bb64d

Environment: http://18.236.111.15:8080 (admin/admin)
Lifetime: 48h auto-cleanup
Updates: New commits create fresh environments automatically

@bito-code-review
Copy link
Copy Markdown
Contributor

bito-code-review Bot commented Jan 9, 2026

Code Review Agent Run #998926

Actionable Suggestions - 0
Review Details
  • Files reviewed - 3 · Commit Range: d983c0d..45bb64d
    • superset-frontend/src/dashboard/actions/dashboardState.js
    • superset-frontend/src/dashboard/components/gridComponents/Tab/Tab.jsx
    • superset-frontend/src/dashboard/components/gridComponents/Tab/Tab.test.tsx
  • Files skipped - 0
  • Tools
    • Eslint (Linter) - ✔︎ Successful
    • Whispers (Secret Scanner) - ✔︎ Successful
    • Detect-secrets (Secret Scanner) - ✔︎ Successful

Bito Usage Guide

Commands

Type the following command in the pull request comment and save the comment.

  • /review - Manually triggers a full AI review.

  • /pause - Pauses automatic reviews on this pull request.

  • /resume - Resumes automatic reviews.

  • /resolve - Marks all Bito-posted review comments as resolved.

  • /abort - Cancels all in-progress reviews.

Refer to the documentation for additional commands.

Configuration

This repository uses Superset You can customize the agent settings here or contact your Bito workspace admin at evan@preset.io.

Documentation & Help

AI Code Review powered by Bito Logo

@codeant-ai-for-open-source
Copy link
Copy Markdown
Contributor

CodeAnt AI is reviewing your PR.


Thanks for using CodeAnt! 🎉

We're free for open-source projects. if you're enjoying it, help us grow by sharing.

Share on X ·
Reddit ·
LinkedIn

@github-actions
Copy link
Copy Markdown
Contributor

🎪 Showtime deployed environment on GHA for 92e5cac

Environment: http://34.209.227.96:8080 (admin/admin)
Lifetime: 48h auto-cleanup
Updates: New commits create fresh environments automatically

@msyavuz msyavuz merged commit 0294c30 into master Jan 10, 2026
69 checks passed
@msyavuz msyavuz deleted the msyavuz/fix/infinite-refresh-bug branch January 10, 2026 15:38
@bito-code-review
Copy link
Copy Markdown
Contributor

Bito Automatic Review Skipped – PR Already Merged

Bito scheduled an automatic review for this pull request, but the review was skipped because this PR was merged before the review could be run.
No action is needed if you didn't intend to review it. To get a review, you can type /review in a comment and save it

sadpandajoe pushed a commit that referenced this pull request Jan 12, 2026
@sadpandajoe sadpandajoe added the v6.0 Label added by the release manager to track PRs to be included in the 6.0 branch label Jan 12, 2026
sadpandajoe pushed a commit that referenced this pull request Jan 12, 2026
jesperct pushed a commit to jesperct/superset that referenced this pull request Jan 19, 2026
sfirke pushed a commit to sfirke/superset that referenced this pull request Apr 13, 2026
devin-ai-integration Bot added a commit to xhcarina/superset that referenced this pull request Apr 20, 2026
- Add AutoRefreshContext mock hooks to Tab.test.tsx so tests can simulate
  isRefreshInFlight/isAutoRefreshing state independently.
- Add three regression tests covering gaps in the existing infinite-loop
  fix (apache#37018):
    * dedup key resets correctly when a second dashboard refresh produces
      a new lastRefreshTime, allowing exactly one additional lazy refresh.
    * Tab does NOT dispatch a lazy refresh while a dashboard refresh is
      already in flight.
    * Tab does NOT dispatch a lazy refresh while an auto-refresh cycle is
      active.
- Spread jest.requireActual for the dashboardState actions mock so the
  reducer keeps its action-type constants in tests.
- Clear the CHART_MOUNT_DELAY setTimeout on unmount / dependency change
  in Tab.tsx to avoid stale dispatches.
devin-ai-integration Bot added a commit to xhcarina/superset that referenced this pull request Apr 20, 2026
Harden the lazy-refresh effect in Tab.tsx to prevent stale dispatches
and stranded dedup keys when a chart lives inside nested tabs.

1. Return a cleanup from the useEffect that clears the CHART_MOUNT_DELAY
   setTimeout. A tab that unmounts (or re-renders with different deps)
   within the 100ms window no longer fires a stale lazy-refresh dispatch.
2. Move the handledRefreshRef dedup-key claim inside the setTimeout
   callback so the key is only claimed after the dispatch actually
   fires. If a guard (isAutoRefreshing / isRefreshInFlight) short-
   circuits the effect, the key is not stranded, and the subsequent
   effect run can still schedule the refresh.

Adds four regression tests in Tab.test.tsx covering:
- isRefreshInFlight and isAutoRefreshing short-circuit paths
- setTimeout cleanup on unmount
- Dedup key reschedule after a guarded short-circuit clears

Related: apache#39439, apache#37018
Co-Authored-By: bot_apk <apk@cognition.ai>
qfcwell pushed a commit to qfcwell/superset that referenced this pull request May 12, 2026
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

dashboard:tab Related to the usage of tabs in the Dashboard preset-io size/L v6.0 Label added by the release manager to track PRs to be included in the 6.0 branch 🎪 ⌛ 48h Environment expires after 48 hours (default)

Projects

None yet

Development

Successfully merging this pull request may close these issues.

Infinite chart reload loop inside nested tabs on force refresh (v6, not present on v3.1.0)

3 participants