Skip to content

Conversation

@sadpandajoe
Copy link
Member

SUMMARY

Fixes an infinite reload loop in Dashboard context where table charts would continuously re-query, causing hundreds/thousands of API calls per user.

Root Cause: The recent "Export table data with Search box" feature (PR #36281) added clientView to ownState on every filtered-row change. In Dashboard context, getRelevantDataMask passed this through unchanged, causing Dashboard.jsx to see continuous state changes and trigger re-queries in an infinite loop.

Fix: Strip clientView from ownState in getRelevantDataMask (the selector that extracts chart state for Dashboard). This matches the existing pattern in ExploreViewContainer which already strips clientView before comparing state changes.

  // Before: passed ownState through unchanged
  .map(item => [item.id, item[prop]])

  // After: strips clientView when prop is 'ownState'
  .map(item => [
    item.id,
    prop === 'ownState' ? omit(item[prop], ['clientView']) : item[prop],
  ])

Why this location: clientView is explicitly for export functionality, not for triggering re-queries. Stripping at the selector level ensures Dashboard never sees these changes as state updates.

BEFORE/AFTER SCREENSHOTS OR ANIMATED GIF

TESTING INSTRUCTIONS

  1. Open a dashboard containing a table chart with server-side pagination disabled
  2. Apply a filter or interact with the table search box
  3. Open browser DevTools → Network tab
  4. Verify there are NO repeated /api/v1/chart/data calls
  5. Verify the "Export" functionality still works correctly (exports filtered data)

ADDITIONAL INFORMATION

  • Has associated issue: Fixes Table charts reloading non-stop #36595
  • 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

@sadpandajoe sadpandajoe requested a review from Copilot December 17, 2025 01:09
@sadpandajoe sadpandajoe added the 🎪 ⚡ showtime-trigger-start Create new ephemeral environment for this PR label Dec 17, 2025
@github-actions github-actions bot added 🎪 0770786 🚦 building Environment 0770786 status: building 🎪 0770786 📅 2025-12-17T01-10 Environment 0770786 created at 2025-12-17T01-10 🎪 0770786 🤡 sadpandajoe Environment 0770786 requested by sadpandajoe 🎪 ⌛ 48h Environment expires after 48 hours (default) and removed 🎪 ⚡ showtime-trigger-start Create new ephemeral environment for this PR labels Dec 17, 2025
@github-actions
Copy link
Contributor

🎪 Showtime is building environment on GHA for 0770786

Copy link
Contributor

Copilot AI left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Pull request overview

This PR fixes a critical infinite reload loop in dashboard table charts caused by the clientView property being continuously written to ownState. The fix strips clientView from ownState in the getRelevantDataMask selector, preventing Dashboard from seeing these changes as state updates that trigger re-queries.

Key changes:

  • Modified getRelevantDataMask to strip clientView from ownState using lodash omit
  • Added comprehensive unit tests in activeAllDashboardFilters.test.ts covering the fix and edge cases
  • Added integration tests in Dashboard.test.jsx verifying Dashboard behavior with ownDataCharts changes

Reviewed changes

Copilot reviewed 3 out of 3 changed files in this pull request and generated no comments.

File Description
superset-frontend/src/dashboard/util/activeAllDashboardFilters.ts Added logic to strip clientView from ownState in the getRelevantDataMask selector, preventing infinite reload loops
superset-frontend/src/dashboard/util/activeAllDashboardFilters.test.ts Added 4 comprehensive test cases covering clientView stripping behavior, equality checks, and verifying other properties remain unchanged
superset-frontend/src/dashboard/components/Dashboard.test.jsx Added 2 integration tests verifying Dashboard correctly handles ownDataCharts updates when clientView changes are filtered out

The implementation correctly mirrors the existing pattern in ExploreViewContainer (lines 606 and 946) where clientView is already stripped. The fix is minimal, well-tested, and addresses the root cause at the selector level where Dashboard receives state updates.

@github-actions github-actions bot added 🎪 0770786 🚦 deploying Environment 0770786 status: deploying 🎪 0770786 🚦 running Environment 0770786 status: running 🎪 🎯 0770786 Active environment pointer - 0770786 is receiving traffic 🎪 0770786 🌐 35.92.7.123:8080 Environment 0770786 URL: http://35.92.7.123:8080 (click to visit) and removed 🎪 0770786 🚦 building Environment 0770786 status: building 🎪 0770786 🚦 deploying Environment 0770786 status: deploying 🎪 0770786 🚦 running Environment 0770786 status: running 🎪 🎯 0770786 Active environment pointer - 0770786 is receiving traffic labels Dec 17, 2025
@github-actions
Copy link
Contributor

🎪 Showtime deployed environment on GHA for 0770786

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

@sadpandajoe sadpandajoe force-pushed the fix-table-chart-reload branch from 0770786 to b6e572c Compare December 17, 2025 05:06
@github-actions github-actions bot added 🎪 b6e572c 🚦 building Environment b6e572c status: building 🎪 b6e572c 📅 2025-12-17T05-07 Environment b6e572c created at 2025-12-17T05-07 🎪 b6e572c 🤡 sadpandajoe Environment b6e572c requested by sadpandajoe labels Dec 17, 2025
@github-actions
Copy link
Contributor

🎪 Showtime is building environment on GHA for b6e572c

@github-actions github-actions bot added 🎪 b6e572c 🚦 deploying Environment b6e572c status: deploying 🎪 b6e572c 🚦 running Environment b6e572c status: running and removed 🎪 b6e572c 🚦 building Environment b6e572c status: building 🎪 b6e572c 🚦 deploying Environment b6e572c status: deploying labels Dec 17, 2025
@github-actions github-actions bot removed the 🎪 0770786 🚦 running Environment 0770786 status: running label Dec 17, 2025
@github-actions
Copy link
Contributor

🎪 Showtime deployed environment on GHA for b6e572c

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

Strip clientView from ownState in getRelevantDataMask to prevent
infinite reload loops in dashboard context. TableChart writes
clientView to ownState on every filtered-row change for export
functionality, but clientView changes should NOT trigger chart
re-queries.

This matches the behavior already present in ExploreViewContainer
which strips clientView before comparing ownState changes.

Fixes #36595

🤖 Generated with [Claude Code](https://claude.com/claude-code)

Co-Authored-By: Claude Opus 4.5 <noreply@anthropic.com>
@sadpandajoe sadpandajoe force-pushed the fix-table-chart-reload branch from b6e572c to 9e6d1c7 Compare December 17, 2025 05:29
@github-actions github-actions bot added 🎪 9e6d1c7 🚦 building Environment 9e6d1c7 status: building 🎪 9e6d1c7 📅 2025-12-17T05-29 Environment 9e6d1c7 created at 2025-12-17T05-29 🎪 9e6d1c7 🤡 sadpandajoe Environment 9e6d1c7 requested by sadpandajoe labels Dec 17, 2025
@github-actions
Copy link
Contributor

🎪 Showtime is building environment on GHA for 9e6d1c7

@github-actions github-actions bot added 🎪 9e6d1c7 🚦 deploying Environment 9e6d1c7 status: deploying 🎪 9e6d1c7 🚦 running Environment 9e6d1c7 status: running 🎪 🎯 9e6d1c7 Active environment pointer - 9e6d1c7 is receiving traffic 🎪 9e6d1c7 📅 2025-12-17T05-30 Environment 9e6d1c7 created at 2025-12-17T05-30 🎪 9e6d1c7 🌐 35.86.137.108:8080 Environment 9e6d1c7 URL: http://35.86.137.108:8080 (click to visit) and removed 🎪 9e6d1c7 🚦 building Environment 9e6d1c7 status: building 🎪 9e6d1c7 🚦 deploying Environment 9e6d1c7 status: deploying 🎪 9e6d1c7 🚦 running Environment 9e6d1c7 status: running 🎪 🎯 9e6d1c7 Active environment pointer - 9e6d1c7 is receiving traffic 🎪 9e6d1c7 📅 2025-12-17T05-29 Environment 9e6d1c7 created at 2025-12-17T05-29 🎪 b6e572c 🤡 sadpandajoe Environment b6e572c requested by sadpandajoe 🎪 b6e572c 📅 2025-12-17T05-07 Environment b6e572c created at 2025-12-17T05-07 🎪 b6e572c 🚦 running Environment b6e572c status: running 🎪 b6e572c 🌐 54.218.182.98:8080 Environment b6e572c URL: http://54.218.182.98:8080 (click to visit) labels Dec 17, 2025
@github-actions
Copy link
Contributor

🎪 Showtime deployed environment on GHA for 9e6d1c7

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

@sadpandajoe sadpandajoe marked this pull request as ready for review December 17, 2025 21:29
@dosubot dosubot bot added the dashboard:performance Related to Dashboard performance label Dec 17, 2025
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

dashboard:performance Related to Dashboard performance review:draft size/L 🎪 9e6d1c7 🚦 running Environment 9e6d1c7 status: running 🎪 9e6d1c7 🤡 sadpandajoe Environment 9e6d1c7 requested by sadpandajoe 🎪 9e6d1c7 🌐 35.86.137.108:8080 Environment 9e6d1c7 URL: http://35.86.137.108:8080 (click to visit) 🎪 9e6d1c7 📅 2025-12-17T05-30 Environment 9e6d1c7 created at 2025-12-17T05-30 🎪 ⌛ 48h Environment expires after 48 hours (default)

Projects

None yet

Development

Successfully merging this pull request may close these issues.

Table charts reloading non-stop

1 participant