Skip to content

fix: setValidState embed API fails with tr=inf and no grain - #9824

Merged
AdityaHegde merged 2 commits into
mainfrom
fix/inf-time-range-failure
Aug 21, 2026
Merged

fix: setValidState embed API fails with tr=inf and no grain#9824
AdityaHegde merged 2 commits into
mainfrom
fix/inf-time-range-failure

Conversation

@AdityaHegde

Copy link
Copy Markdown
Collaborator

Calling setValidState with tr=inf in the url param and no grain would return an error, Selected time grain: "undefined" is not valid. This is because we do not have a valid derived grain for inf time range, but an error here doesnt make sense.

Updating to only throw when the derived grain is valid. Absense of grain will be backfilled in other parts of the code. A unification of time controls calc is pending, this should be fixed there and the backfilled grain should be derived upfront.

Checklist:

  • Covered by tests
  • Ran it and it works as intended
  • Reviewed the diff before requesting a review
  • Checked for unhandled edge cases
  • Linked the issues it closes
  • Checked if the docs need to be updated. If so, create a separate Linear DOCS issue
  • Intend to cherry-pick into the release branch
  • I'm proud of this work!

@AdityaHegde
AdityaHegde requested a review from pjain1 August 20, 2026 14:18
@pjain1
pjain1 requested a balanced review from Copilot August 20, 2026 15:18

Copilot AI left a comment

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.

Pull request overview

Allows all-time URL ranges without an explicit grain to pass validation.

Changes:

  • Only reports invalid derived grains when a grain exists.
  • Leaves missing grains for downstream backfilling.

💡 Add a code-review agent skill or configure MCP servers for context-aware, tailored reviews. Learn more in the docs.

@pjain1 pjain1 left a comment

Copy link
Copy Markdown
Member

Choose a reason for hiding this comment

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

There is a comment from copilot.

@AdityaHegde
AdityaHegde merged commit 799dd98 into main Aug 21, 2026
10 checks passed
@AdityaHegde
AdityaHegde deleted the fix/inf-time-range-failure branch August 21, 2026 05:02
AdityaHegde added a commit that referenced this pull request Aug 21, 2026
* fix: setValidState embed API fails with tr=inf and no grain

* Add direct convertURLSearchParamsToExploreState tests
@nishantmonu51 nishantmonu51 added Type:Bug Something isn't working Area:Dashboard Size:S Small change: under 100 lines labels Sep 1, 2026
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

Area:Dashboard Size:S Small change: under 100 lines Type:Bug Something isn't working

Projects

None yet

Development

Successfully merging this pull request may close these issues.

4 participants