Skip to content

Conversation

@Zylphrex
Copy link
Member

This is trying to address a few problems with the date page filter.

  1. the PageFiltersContainer does not set max pickable days so it properly resets when coming from pages that may have a longer max pickable days like explore > traces
  2. the TimeRangeSelector hard codes 90 as the max pickable days but in saas, this max pickable days changes based on the plan (and coming soon, the data category)

This is trying to address a few problems with the date page filter.
1. the `PageFiltersContainer` does not set max pickable days so it properly
   resets when coming from pages that may have a longer max pickable days like
   explore > traces
2. the `TimeRangeSelector` hard codes 90 as the max pickable days but in saas,
   this max pickable days changes based on the plan (and coming soon, the data
   category)
@Zylphrex Zylphrex requested a review from a team as a code owner November 27, 2025 19:01
@github-actions github-actions bot added the Scope: Frontend Automatically applied to PRs that change frontend components label Nov 27, 2025

const defaultMaxPickableDays = useDefaultMaxPickableDays();
maxPickableDays = maxPickableDays ?? defaultMaxPickableDays;

Copy link
Contributor

Choose a reason for hiding this comment

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

Bug: Stale closure captures wrong maxPickableDays value

The doInitialization function captures maxPickableDays computed from useDefaultMaxPickableDays() hook, but the useLayoutEffect at lines 120-129 doesn't include maxPickableDays or defaultMaxPickableDays in its dependency array. When subscription data loads asynchronously after initial mount, the component re-renders with updated defaultMaxPickableDays, creating a new doInitialization with the correct value, but the effect doesn't re-run. This causes page filters to initialize with stale maxPickableDays (typically 90 instead of the subscription's retention days like 30), allowing users to select date ranges beyond their plan limits.

Fix in Cursor Fix in Web

@Zylphrex Zylphrex merged commit 81497aa into master Dec 1, 2025
48 checks passed
@Zylphrex Zylphrex deleted the txiao/feat/set-default-max-pickable-days branch December 1, 2025 15:27
jerryzhou196 pushed a commit that referenced this pull request Dec 1, 2025
This is trying to address a few problems with the date page filter.
1. the `PageFiltersContainer` does not set max pickable days so it
properly resets when coming from pages that may have a longer max
pickable days like explore > traces
2. the `TimeRangeSelector` hard codes 90 as the max pickable days but in
saas, this max pickable days changes based on the plan (and coming soon,
the data category)
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.

3 participants