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

QueryAll bug #463

Closed
heshamMassoud opened this issue Oct 15, 2019 · 1 comment · Fixed by #464
Closed

QueryAll bug #463

heshamMassoud opened this issue Oct 15, 2019 · 1 comment · Fixed by #464

Comments

@heshamMassoud
Copy link
Contributor

Opened from a support ticket

I found a bug in the commercetools-sync-java:1.5.0 library.

I use the

CtpQueryUtils.queryAll(sphereClient, productQuery, pageCallback, pageSize).toCompletableFuture().join();

Static method to do a paged query.
My productQuery is:

ProductReferenceReplacementUtils.buildProductQuery()
.plusPredicates(m -> m.productType().is(ProductType.reference(productType)))

The result is, that I get in the FIRST page loop only products with the right product type and in all other loops all products. The reason is that the line

QueryAll.java:167 return client.execute(queryPredicate != null ? query.withPredicates(queryPredicate) : query);

Overwrites MY predicate. Therefore a solution would be to change the withPredicate to plusPredicate.

@heshamMassoud
Copy link
Contributor Author

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 a pull request may close this issue.

1 participant