Skip to content

Commit

Permalink
fix(chart-unfurls): Fix unfurls with top events (#29119)
Browse files Browse the repository at this point in the history
Chart unfurls are currently broken when top
events when they are passed in with events
with non-top event display types.
  • Loading branch information
shruthilayaj authored Oct 7, 2021
1 parent 7a25e4e commit 394cc10
Showing 1 changed file with 5 additions and 0 deletions.
5 changes: 5 additions & 0 deletions src/sentry/integrations/slack/unfurl/discover.py
Original file line number Diff line number Diff line change
Expand Up @@ -95,6 +95,7 @@ def unfurl_discover(

if "daily" in display_mode:
params.setlist("interval", ["1d"])

if "top5" in display_mode:
if features.has("organizations:discover-top-events", org):
params.setlist(
Expand All @@ -104,6 +105,10 @@ def unfurl_discover(
)
else:
params.setlist("topEvents", [f"{TOP_N}"])
else:
# topEvents param persists in the URL in some cases, we want to discard
# it if it's not a top n display type.
params.pop("topEvents", None)

try:
resp = client.get(
Expand Down

0 comments on commit 394cc10

Please sign in to comment.