fix(slack): Apply dashboard-stored filters when unfurling widget URLs#113711
Merged
DominikB2014 merged 2 commits intomasterfrom Apr 22, 2026
Conversation
The dashboards unfurl handler read project, environment, and date range only from URL query params, and many dashboard widget URLs pasted into Slack carry no query params at all. That produced blank charts: no project filter meant the events-timeseries call returned no data. Resolve page filters with URL > dashboard-saved (Dashboard.get_filters) > FE defaults, matching what the dashboard page shows when opened directly. When no project is configured anywhere, fall back to ALL_ACCESS_PROJECT_ID so unfurls still render data instead of an empty chart. Also bump DEFAULT_PERIOD from 14d to 24h to match the dashboards-specific DEFAULT_STATS_PERIOD in dashboards/data.tsx. localStorage-pinned filters are intentionally not replicated; they aren't reachable from a webhook context. Refs DAIN-1574 Co-Authored-By: Claude <noreply@anthropic.com>
Contributor
There was a problem hiding this comment.
Cursor Bugbot has reviewed your changes and found 1 potential issue.
❌ Bugbot Autofix is OFF. To automatically fix reported issues with cloud agents, enable autofix in the Cursor dashboard.
Reviewed by Cursor Bugbot for commit 634fb4b. Configure here.
The events-timeseries endpoint doesn't consume a utc param, so forwarding it from URL or dashboard-saved filters was dead code. On top of that, unfurled charts are viewed across mixed-timezone Slack audiences, where a single viewer's utc preference isn't meaningful. Drop it from both paths and update the dashboard start/end test to assert utc is absent.
edwardgou-sentry
approved these changes
Apr 22, 2026
3 tasks
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Add this suggestion to a batch that can be applied as a single commit.This suggestion is invalid because no changes were made to the code.Suggestions cannot be applied while the pull request is closed.Suggestions cannot be applied while viewing a subset of changes.Only one suggestion per line can be applied in a batch.Add this suggestion to a batch that can be applied as a single commit.Applying suggestions on deleted lines is not supported.You must change the existing code in this line in order to create a valid suggestion.Outdated suggestions cannot be applied.This suggestion has been applied or marked resolved.Suggestions cannot be applied from pending reviews.Suggestions cannot be applied on multi-line comments.Suggestions cannot be applied while the pull request is queued to merge.Suggestion cannot be applied right now. Please check back later.

Pasting a dashboard widget URL into Slack produced a blank chart when the URL had no query params. The unfurl handler read
project,environment, and the date range exclusively from URL params, so a bare/dashboard/{id}/widget/{index}/link sent anevents-timeseriesrequest with no project filter and returned no data.The dashboard UI itself resolves those filters from
Dashboard.projects/Dashboard.filters(and its ownDEFAULT_STATS_PERIOD='24h') when the URL doesn't carry them. This change mirrors that precedence server-side:Dashboard.get_filters()— projects, environment, period, start/end, utc, and theall_projectssentinelDEFAULT_PERIODbumped from14dto24hto matchstatic/app/views/dashboards/data.tsx; project falls back toALL_ACCESS_PROJECT_ID(-1) so unconfigured dashboards still render data instead of an empty chartDate range is treated as a unit: if the URL carries any of
statsPeriod/start/end, the dashboard-saved range is ignored (no mixing URLstatsPeriodwith a savedstart/end).localStorage-pinned
PageFiltersare deliberately not replicated — they aren't reachable from a webhook context, and dashboards passdisablePersistence={true}anyway.Also adds
select_related("dashboard")to_get_widgetso accessingwidget.dashboard.get_filters()doesn't trigger an extra lazy query.Refs DAIN-1574