Skip to content

fix(client-vue3): prevent heuristic call when initial query is empty in computed property validateQuery #9656

New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Merged

Conversation

AyHaski
Copy link
Contributor

@AyHaski AyHaski commented Jun 4, 2025

Check List

  • Tests have been run in packages where changes made if available
  • Linter has been run for changed code
  • Tests for the changes have been added if not covered yet

Description of Changes Made

At the moment, if the query is empty in the beginning of the render process, as the query is passed as a prop, the computed property validatedQuery will set the variable skipHeuristics to false on the second computation run even if the query is still empty. When the query is filled afterwards, even though it is the initial query, the heuristic function is called, an changes to the query are made for example adding granularity and order options, which aren't present on the initial query passed. It seems that in vue3 the computed property are triggered more times than before, which resulted in this problem.

The fix prevents that until the query is actually loaded the heuristic function is not called.

@AyHaski AyHaski requested a review from a team as a code owner June 4, 2025 11:20
@github-actions github-actions bot added the pr:community Contribution from Cube.js community members. label Jun 4, 2025
@KSDaemon KSDaemon requested a review from vasilev-alex June 6, 2025 12:19
Copy link
Member

@KSDaemon KSDaemon left a comment

Choose a reason for hiding this comment

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

👍🏻 LGTM!

@KSDaemon KSDaemon merged commit 622b266 into cube-js:master Jun 6, 2025
28 of 29 checks passed
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
pr:community Contribution from Cube.js community members.
Projects
None yet
Development

Successfully merging this pull request may close these issues.

3 participants