Closed tonyghita closed 7 years ago
I took a shot at a possible resolution that fixes the panics in 9574d86. Let me know what you think @nicksrandall.
I had almost that exact same code in there before but I pulled it out. I can see how it would be a hard issue to hunt down so I'm ok with adding it back in.
Currently there is no check that the number of items returned from a user-supplied batch function is the same as the number of requests.
This causes an uncaught panic when it occurs. The reference implementation throws an informative error in this case (https://github.com/facebook/dataloader/blob/master/src/index.js#L271-L280).
I wrote a failing test case to show the issue, but I'm not sure as to the best solution here.
This change is