Conversation
… if a different guid is provided every time (the previous client behavior) or if no guid is provided.
|
I think I see your point with regard to send a POST request with a newly generated uuid; it really does nothing with respect to using the: guid(an optional parameter to enforce idempotence for POST requests) feature supported on the /invoices endpoint, etc. We really should be allowing the callers of the post method in rest_connector to pass in the guid to make full use of this feature. So, in the case of returning a response from process_request to post and then to the caller, I would also include the guid that was either generated or passed in to the post method. As such, there really is no reason to pluck the guid field out summarily. @btalbot stated:
Yet our documentation stipulates that the guid field would enforce idempotence for POST requests, meaning that subsequent POST requests using the same guid would achieve idempotence. Since the current behavior of the ruby-client is to create a new guid value for each POST request, we are implicitly disregarding this feature altogether. |
|
The only way for a client to ensure that a bitpay resources is created exactly once for a given client-side resource (say to create a bitpay invoice for a client order) is for the client to generate the This way, if the client disconnects or crashes before it is able to process the (successful) response from bitpay, to recover, it can simply find the order, and resubmit it again using the Having the sdk generate a |
The API seems to behave the same if a different guid is provided every time (the previous client behavior) or if no guid is provided.
Creating a random guid for every POST request breaks the idempotency intent of the API by making every POST unique and makes creating a reliable application very difficult.