Closed iulianb closed 3 years ago
Interesting. Thanks for the test.
I haven't tried running it yet, but I'm looking at these lines:
const equals = new breeze.Predicate('productID', breeze.FilterQueryOp.Equals, 1);
const lessThan = new breeze.Predicate('productID', breeze.FilterQueryOp.LessThan, 1);
const predicate = breeze.Predicate.and(equals, lessThan);
The predicate
is looking for any productID
that is both equal to 1 AND less than one, which is impossible. If it should be OR instead of AND, then the code should just be
const predicate = breeze.Predicate('productID', breeze.FilterQueryOp.LessThanOrEqual, 1);
Of course, none of this explains the strange error that you got, and it probably won't help with your DevExtreme problem. I'll see what's going on in your test.
Yes, the predicate doesn't really make sense (it's actually just the troublesome part of a more branchy one) and I should probably also check why DevExtreme generates it but breeze crashed because of it and I thought it might be a bug.
Yep, it was a bug. The error was in some code that attempts to combine predicates. It'll be fixed in the next release.
Out of curiosity, is DevExtreme creating Breeze predicates? Or have you written something that converts DevExtreme's queries into Breeze?
Thanks again for finding this.
Fixed in release 2.0.9
DevExtreme has an adapter that translates the internal filter data structure into breeze predicates. It can be found here: https://github.com/DevExpress/DevExtreme-Data-BreezeJS.
Thank you for the fix!
@iulianb the DevExtreme adapter has been archived and is no longer maintained. It actually has a number of issues that we've reported to them, but never heard anything back. Just something to be aware of. We have used DevExtreme on several projects ourselves, but have resorted to writing our own layer to interact with Breeze. We do offer consulting if you are interested in a more robust and supported integration between DevExtreme and Breeze.
@marcelgood Yes, I'm aware of that. We did change some of the stuff in there to suit our needs. I'll discuss your offer with the managers. Thank you!
The UI library we're using (DevExtreme) generates a where predicate that seems to cause some serialization issues in breeze. I'm attaching a test that reproduces the exception.
Haven't looked into what causes it but I'm willing to investigate and submit a PR if needed.