Small 'bug' in create_working_order #361
PurpleHazeIan
started this conversation in
General
Replies: 0 comments
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Uh oh!
There was an error while loading. Please reload this page.
-
The chances of this happening are very small, but I have just seen it happen; how long I need to wait before I see it again I do not know.
The final step of
IGService.create_working_order()is to callIGService.fetch_deal_by_deal_reference(deal_reference)to confirm that thedeal_referenceis on the list of working orders. There is a very small possibility that the order has actually executed, in which case it is no longer on the list. What gets returned is the Exceptionerror.confirms.deal-not-foundwhich is strictly correct in the circumstances but possibly misleading and not helpful in that neitherdeal_idnordeal_referenceare made available to search conveniently in the activity history. Net result is that the order has executed but the caller is told that there was an error and is likely to infer that the order failed.This is probably rare and possibly unavoidable, but I wondered why the code does this further check rather than simply returning the response from the create itself.
Ultimately of course the user must always check what their code leads them to believe against what actually happened!
Beta Was this translation helpful? Give feedback.
All reactions