Force.com-Toolkit-for-NET icon indicating copy to clipboard operation
Force.com-Toolkit-for-NET copied to clipboard

RunJobAndPollAsync - non-deterministic order of results

Open michal-gajek-lingaro opened this issue 4 years ago • 1 comments
trafficstars

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?

image

michal-gajek-lingaro avatar Jan 18 '21 09:01 michal-gajek-lingaro

@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)

marcin-rogoz94 avatar Dec 05 '23 15:12 marcin-rogoz94