The id for the offers is wrong.
I've narrowed down the issue to OffersService.Create() line 81-82.
The problem is that we use UsersService.GetByEmail() and this method uses ThreadPrincipal.Current to get the currently logged in user.
So the underlying issue is that the operation is executed on different threads, because WorkflowApplication uses threads from the threadpool instead of the one that the request came in, and i'm not sure what can be done about this.
I've fixed this particular issue by stamping the entity on the main thread, in the service class, and made the Stamper.Stamp method exit if a stamp already exists.
The id for the offers is wrong. I've narrowed down the issue to OffersService.Create() line 81-82. The problem is that we use UsersService.GetByEmail() and this method uses ThreadPrincipal.Current to get the currently logged in user. So the underlying issue is that the operation is executed on different threads, because WorkflowApplication uses threads from the threadpool instead of the one that the request came in, and i'm not sure what can be done about this.