davesag/ir-api

Bad nonce error

Closed this issue · 1 comments

The system is performing parallel calls, getting errors from IR about a bad nonce:

Invalid credentials (bad nonce). This nonce=1633513773166, last valid nonce=1633513953574

could be related to #41

Hi @oleg-koval interesting. If I understand correctly you trying to perform a number of operations in parallel? I can see why that might trigger a bad-nonce if a function called earlier takes longer to assemble than a subsequent call. then the posts would be out of order.

According to the API docs:

The API is rate limited to 1 call per second

I expect this is to prevent exactly this scenario.

The issue is that the nonce must be created when the signature for the payload is computed, not when the actual post is sent.

Please avoid making calls that need a nonce in parallel.

I don't attempt any kind of rate limiting in this API but if you want to give that a go, please feel free to raise a PR

Cheers

Dave