Skip to content

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

Open
AdityaHegde wants to merge 2 commits into
mainfrom
fix/inf-time-range-failure
Open

fix: setValidState embed API fails with tr=inf and no grain#9824
AdityaHegde wants to merge 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.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

4 participants