Repository navigation
Conversation
- Added refreshKey state to trigger re-fetch of activity data - Added onActivityRefresh callback prop to DashboardTable and ChartTable - Activity section now updates automatically after delete operations Fixes #39435
Co-Authored-By: Claude Opus 4.8 <noreply@anthropic.com>
- DashboardTable: only fire onActivityRefresh once the delete actually succeeds and triggers a real refetch, instead of immediately alongside the fire-and-forget delete call (which could race ahead of the backend delete and refresh with stale data). - Home/Welcome: guard the recent-activity effect against out-of-order responses when refreshKey changes again before an in-flight refresh resolves, so an older response can no longer overwrite newer state. Addresses CodeAnt review feedback on PR #39528.
handleChartDelete calls getData(chartFilter) instead of refreshData whenever chartFilter is set and isn't 'Mine' (i.e. for the default Other/All tab), but ChartTable was passing the raw, unwrapped getData to that path - so deleting a chart from any tab other than Mine never fired onActivityRefresh at all. DashboardTable already wraps its equivalent getData call (handleGetData); mirrors that same fix here. Also adds the test coverage for the onActivityRefresh wiring that was asked for across review rounds - this exact gap only showed up once a test exercised the non-Mine delete path. Co-Authored-By: Evan Rusackas <evan@preset.io> Co-Authored-By: Claude Sonnet 5 <noreply@anthropic.com>
Adopting this fix as a fresh PR since the OAuth token used here lacks the `workflow` scope needed to push directly to the contributor's fork. The preceding commits are unchanged aside from a rebase onto current master, plus one follow-up fix (wrap getData in ChartTable so the activity refresh covers all tabs, not just Mine) and test coverage for the onActivityRefresh wiring that review rounds had asked for. Co-Authored-By: Puja Gupta <puja.ec676@gmail.com> Co-Authored-By: Evan Rusackas <evan@preset.io> Co-Authored-By: Claude Sonnet 5 <noreply@anthropic.com>
Codecov Report❌ Patch coverage is
Additional details and impacted files@@ Coverage Diff @@
## master #45589 +/- ##
==========================================
- Coverage 84.63% 84.38% -0.26%
==========================================
Files 3069 3069
Lines 205446 202493 -2953
Branches 48306 47641 -665
==========================================
- Hits 173879 170871 -3008
- Misses 28277 28380 +103
+ Partials 3290 3242 -48
Flags with carried forward coverage won't be shown. Click here to find out more. ☔ View full report in Codecov by Harness. 🚀 New features to boost your workflow:
|
…ighten delete test Co-Authored-By: Evan Rusackas <evan@preset.io> Co-Authored-By: Claude Sonnet 5.5 <noreply@anthropic.com>
✅ Deploy Preview for superset-docs-preview ready!
To edit notification comments on pull requests, go to your Netlify project configuration. |
… guard Co-Authored-By: Evan Rusackas <evan@preset.io> Co-Authored-By: Claude Sonnet 5.5 <noreply@anthropic.com>
…e state on refresh Co-Authored-By: Evan Rusackas <evan@preset.io> Co-Authored-By: Claude Sonnet 5.5 <noreply@anthropic.com>
SBIN2010
left a comment
There was a problem hiding this comment.
LGTM!
I don’t think screenshots will provide the full picture here. You really need a video.
…g, drain async work instead of sleeping Co-Authored-By: Evan Rusackas <evan@preset.io> Co-Authored-By: Claude Sonnet 5.5 <noreply@anthropic.com>
…d formatting Co-Authored-By: Evan Rusackas <evan@preset.io> Co-Authored-By: Claude Sonnet 5.5 <noreply@anthropic.com>
Adds recent-activity-refresh.spec.ts, covering all six combinations
of {Favorite, Mine, All} x {Dashboards, Charts}: create a throwaway
asset, view it to seed a real Recents "Viewed" entry, delete it from
the given tab, and assert the Recents entry disappears promptly
rather than lingering.
This was prompted by a video-capture run that appeared to show a
stale Recents entry surviving 15+ seconds after a Mine-tab dashboard
delete. A from-scratch repro (fresh SQLite DB, fresh backend/webpack,
no leftover state) could not reproduce it: the entry disappeared
immediately, across dashboards and charts, on every tab. These tests
pin that correct behavior down as a regression guard, since nothing
previously covered it end-to-end in a real browser.
Extends HomePage with helpers for the Dashboards/Charts card lists
(tab switching, card lookup scoped to the right panel, kebab-menu
delete) and the Recents panel, reused across all six tests.
Co-Authored-By: Evan Rusackas <evan@rusackas.com>
Co-Authored-By: Claude Sonnet 5 <noreply@anthropic.com>
|
Quick update for anyone waiting on the updated demo video. While putting together a Playwright recording covering all three tabs (Favorite/Mine/All) for both Dashboards and Charts, one run appeared to show a dashboard's Recents entry surviving 15+ seconds after deleting it from the Mine tab - which would have meant this fix doesn't actually work in that case. That capture environment had accumulated a lot of cruft (orphaned processes, a possibly-stale webpack bundle), so before touching any code I ran a from-scratch repro instead: fresh SQLite DB, fresh migrations, fresh backend + webpack dev server, nothing left over from prior runs. It could not reproduce the staleness - the Recents entry disappeared immediately on every tab, for both dashboards and charts. That matches what the code shows: To make sure this stays pinned down, I added Still finishing up a cleaner demo video (readable fixture names instead of the long IDs in the current one) - will post it here once it's ready. |
SUMMARY
Refreshes the Home page's Recent Activity section automatically after a dashboard or chart is deleted, instead of requiring a manual page reload. This is a rebase + fix-up of @guptapuja's work in #39528, opened fresh because the token used here lacks the
workflowscope needed to push directly to their fork.Closes #39528 - thanks for the work here @guptapuja!
On top of the rebase, this adds one small fix and some test coverage that review rounds on the original PR had asked for:
ChartTable's delete flow callsgetData(chartFilter)instead ofrefreshDatawhenever the active tab isn't "Mine" - that path was passing the raw, unwrappedgetDatathrough, so deleting a chart from the default/Other tab never fired the newonActivityRefreshcallback at all. Wrapped it the same wayDashboardTablealready wraps its owngetData(handleGetData).onActivityRefreshwiring in bothChartTable.test.tsxandDashboardTable.test.tsx, which is what caught the gap above.A later round added a Playwright E2E suite (
playwright/tests/home/recent-activity-refresh.spec.ts) covering all six combinations of {Favorite, Mine, All} x {Dashboards, Charts}: create a throwaway asset, view it to seed a real Recents entry, delete it from that tab, and assert the Recents entry disappears promptly. See the PR comment below for how that came about.BEFORE/AFTER SCREENSHOTS OR ANIMATED GIF
pr45589-demo-v2.mp4
(A cleaner recording is in progress - see the comment below.)
TESTING INSTRUCTIONS
Or run the new E2E suite:
npx playwright test playwright/tests/home/recent-activity-refresh.spec.ts.ADDITIONAL INFORMATION
🤖 Generated with Claude Code