feat: Set Default max pickable days#104109
Merged
Conversation
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)
|
|
||
| const defaultMaxPickableDays = useDefaultMaxPickableDays(); | ||
| maxPickableDays = maxPickableDays ?? defaultMaxPickableDays; | ||
|
|
Contributor
There was a problem hiding this comment.
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.
nsdeschenes
approved these changes
Dec 1, 2025
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)
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 subscribe to this conversation on GitHub.
Already have an account?
Sign in.
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.
This is trying to address a few problems with the date page filter.
PageFiltersContainerdoes not set max pickable days so it properly resets when coming from pages that may have a longer max pickable days like explore > tracesTimeRangeSelectorhard 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)