Skip to content

feat(ui): extend self-hosted max pickable days#114402

Open
aldy505 wants to merge 2 commits into
getsentry:masterfrom
aldy505:aldy/visibility-max-pickable-days-adjustments-upstream
Open

feat(ui): extend self-hosted max pickable days#114402
aldy505 wants to merge 2 commits into
getsentry:masterfrom
aldy505:aldy/visibility-max-pickable-days-adjustments-upstream

Conversation

@aldy505
Copy link
Copy Markdown
Collaborator

@aldy505 aldy505 commented Apr 30, 2026

Summary

  • make the shared static/app max pickable day default resolve to 180 days for self-hosted orgs with visibility-increased-max-pickable-days
  • expose a shared 180d relative option and reuse the self-hosted-aware default across shared picker consumers
  • extend static-app surfaces that still hard-coded 30/90 day limits, including conversations, crons, issue-detail retention fallbacks, profiling relative time, and the shared data-category picker limits

Depends on #114401
Refs #94602
Refs #105899

Co-authored-by: Copilot <223556219+Copilot@users.noreply.github.com>
@github-actions github-actions Bot added the Scope: Frontend Automatically applied to PRs that change frontend components label Apr 30, 2026
Co-authored-by: Copilot <223556219+Copilot@users.noreply.github.com>
@getsantry
Copy link
Copy Markdown
Contributor

getsantry Bot commented May 21, 2026

This issue has gone three weeks without activity. In another week, I will close it.

But! If you comment or otherwise update it, I will reset the clock, and if you remove the label Waiting for: Community, I will leave it alone ... forever!


"A weed is but an unloved flower." ― Ella Wheeler Wilcox 🥀

@getsantry getsantry Bot added the Stale label May 21, 2026
@aldy505 aldy505 marked this pull request as ready for review May 21, 2026 14:43
@aldy505 aldy505 requested review from a team as code owners May 21, 2026 14:43
(() => MAX_PICKABLE_DAYS);
const maxRetentionDays = useGetMaxRetentionDays();
(() => defaultMaxPickableDays);
const maxRetentionDays = useGetMaxRetentionDays() ?? defaultMaxPickableDays;
Copy link
Copy Markdown
Contributor

Choose a reason for hiding this comment

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

Bug: useGroupDefaultStatsPeriod can return an incorrect '90d' stats period on initial load for SaaS organizations with less than 90 days retention, due to a non-reactive useGetMaxRetentionDays hook.
Severity: MEDIUM

Suggested Fix

Make useGetMaxRetentionDays reactive to changes in the SubscriptionStore. This can be achieved by using a hook like useStoreState or adding a listener to ensure the component re-renders when subscription data becomes available. This will prevent the initial fallback value from persisting incorrectly.

Prompt for AI Agent
Review the code at the location below. A potential bug has been identified by an AI
agent. Verify if this is a real issue. If it is, propose a fix; if not, explain why it's
not valid.

Location: static/app/views/issueDetails/useGroupDefaultStatsPeriod.tsx#L44

Potential issue: On SaaS, `useGetMaxRetentionDays()` can return `undefined` while
subscription data is loading. The new `?? defaultMaxPickableDays` coercion sets
`maxRetentionDays` to 90. This causes `useGroupDefaultStatsPeriod` to return a '90d'
stats period for organizations with retention less than 90 days. Because
`useGetMaxRetentionDays` is not reactive and reads from the store synchronously, the
component does not update when subscription data loads. This results in the incorrect
'90d' period persisting, leading to API queries for data outside the plan's retention
window.

Did we get this right? 👍 / 👎 to inform future reviews.

Copy link
Copy Markdown
Contributor

@cursor cursor Bot left a comment

Choose a reason for hiding this comment

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

Cursor Bugbot has reviewed your changes and found 1 potential issue.

Fix All in Cursor

❌ Bugbot Autofix is OFF. To automatically fix reported issues with cloud agents, enable autofix in the Cursor dashboard.

Reviewed by Cursor Bugbot for commit a2b4572. Configure here.

'14d': t('Last 14 days'),
'30d': t('Last 30 days'),
'90d': t('Last 90 days'),
'180d': t('Last 180 days'),
Copy link
Copy Markdown
Contributor

Choose a reason for hiding this comment

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

Unfiltered 180d option leaks through relativeOptions callbacks

Medium Severity

Adding 180d unconditionally to DEFAULT_RELATIVE_PERIODS causes it to leak into TimeRangeSelector consumers that use relativeOptions as a function callback. The restrictedDefaultPeriods filtering (which respects maxPickableDays) only applies when relativeOptions is not a function. When it is a function, the raw unfiltered DEFAULT_RELATIVE_PERIODS is passed as defaultOptions. Callers like eventDetailsHeader.tsx and releases/detail/overview/index.tsx spread props.defaultOptions directly, so "Last 180 days" will appear on SaaS where maxPickableDays is 90.

Fix in Cursor Fix in Web

Reviewed by Cursor Bugbot for commit a2b4572. Configure here.

@getsantry getsantry Bot removed the Stale label May 22, 2026
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

Scope: Frontend Automatically applied to PRs that change frontend components

Projects

None yet

Development

Successfully merging this pull request may close these issues.

1 participant