What could be the reason of the Commerce API to fail the setItemOptions function after sending the data 2- 3 times in a short period of time. When loading the page works fine, when I send a new data randomly Fails. Meaning I can send the same information one time and works and send the same information later and fails.
f
Flo Meilan
12/07/2020, 7:22 PM
@Santiago it could be due to a race condition
s
Santiago
12/08/2020, 12:56 PM
Doesn't seem like it because although some times I test sneding the request quickly, other times I take a good amount of time to send the request. If this would be the case is there any built in function to be able surpass this issue?
Also the truth is that 2 weeks ago I could send request without any issues.
Santiago
12/10/2020, 4:21 PM
@Flo Meilan Maybe this gives you more of an idea of this strange issue, those are the request the time stamp and the headers, and a image of the code some times it works and some times gives me the Failed to update item options. My question is if it's a race condition how could I now that the commerce API has finished with the settings or do I need to submit the order from the commerce API?
Santiago
12/11/2020, 3:16 PM
ERR_WS_UPDATE_ITEM_OPTIONS this is the error I get when I try to setItemOptions with the Commerce API
k
Kearobi
12/14/2020, 3:18 AM
@Santiago, have you tried only setting the order? Do you get the same error?
s
Santiago
12/14/2020, 1:09 PM
@Kearobi No I do not get the error, the thing is that those item options are setted on the checkout process via script on page load and then when options are changed, on page load we don't get any errors, and sometimes when we change an option the error appears or not, it's random.