Skip to content
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

Fix param added with empty query ignores options #4736

Merged
merged 1 commit into from
Apr 14, 2020

Conversation

gabrieldutra
Copy link
Member

@gabrieldutra gabrieldutra commented Mar 17, 2020

What type of PR is this? (check all applicable)

  • Bug Fix

Description

This one was a bit hard to find 😅. From what I understood on this code:

if (this.query.query && this.query.query === this.cachedQueryText) {
const parameters = this.query.options.parameters;
const hasUnprocessedParameters = find(parameters, p => !(p instanceof Parameter));
if (hasUnprocessedParameters) {
this.query.options.parameters = map(parameters, p =>
p instanceof Parameter ? p : createParameter(p, this.query.id)
);
}
return;
}

It exists to determine when to skip parameters sync (query text with actual parameters list in query object). Since parameters are added in a context of inequality between the cachedQuery and the query text, the idea is to keep those parameters in there until the query text is modified (what wasn't happening for an empty query text)

Related Tickets & Documents

Fixes #4723
and #4146 is the one that triggered this context to be possible

Mobile & Desktop Screenshots/Recordings (if there are UI changes)

--

@gabrieldutra gabrieldutra requested review from rauchy and kravets-levko and removed request for rauchy March 20, 2020 14:21
@arikfr arikfr merged commit 3df1a86 into master Apr 14, 2020
@arikfr arikfr deleted the fix-add-parameters-with-empty-query branch April 14, 2020 08:41
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
Projects
None yet
Development

Successfully merging this pull request may close these issues.

Parameters added in empty queries are always added as text parameters
2 participants