You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
Invoke BatchDataLoader multiple times, passing down different values of keys.
What is expected?
Results from the database should match accordingly to the passed keys.
What is actually happening?
Incorrect results are being returned.
The constructed SQL contains keys in the query from the first BatchDataLoader invocation.
Relevant log output
Additional context
I did a bit of investigation on a side and the issue boils down to how HC reuses a list to populate the keys under the hood.
That causes a weird interaction with EF.
With list reusal:
Without list reusal:
The text was updated successfully, but these errors were encountered:
This is as designed. We by default rent a list for keys in DataLoader. If you want to use it in combination with EF.Constant you need to allocate a list that you can pass on by doing a ToList or ToArray on the keys.
Product
Hot Chocolate
Version
14.1.0
Link to minimal reproduction
https://gist.github.com/kresimirlesic/32e39360f8ec10b6285f58721ec7d69c
Steps to reproduce
Invoke BatchDataLoader multiple times, passing down different values of keys.
What is expected?
Results from the database should match accordingly to the passed keys.
What is actually happening?
Incorrect results are being returned.
The constructed SQL contains keys in the query from the first BatchDataLoader invocation.
Relevant log output
Additional context
I did a bit of investigation on a side and the issue boils down to how HC reuses a list to populate the keys under the hood.
That causes a weird interaction with EF.
With list reusal:

Without list reusal:

The text was updated successfully, but these errors were encountered: