Force.com-Toolkit-for-NET
Force.com-Toolkit-for-NET copied to clipboard
RunJobAndPollAsync - non-deterministic order of results
When using RunJobAndPollAsync with multiple batches in one call, I've an occasional issue caused by (apparently) non-deterministic order of the results (order of batches).
I'm sending a list of two batches, 20 and 5 items respectively. Sometimes what I receive is two lists of results, 5 and 20 items, respectively. (Please see the debugger screenshot below)
This makes it impossible to determine which result item corresponds to which batch item. Am I missing a better way to match results to input items?

@michal-gajek-lingaro I encountered same problem. Based on issue activity I can assume that it will not be fixed.
I assume you found solution but it may be helpful for someone else. As a workaround you can write custom Run and Poll logic with help of RunJobAsync, PollBatchAsync and GetBatchResultAsync methods (here is link to core implementation - https://github.com/wadewegner/Force.com-Toolkit-for-NET/blob/279cefeca536c13f8018ac5f80de4d81291d0dd7/src/ForceToolkitForNET/ForceClient.cs#L317)