sugarskins/csgo-steam-eth-trade

fix concurrent resolution of scans

Closed this issue · 1 comments

Currently if you submit 2+ scan requests concurrently it may cause a server failure due to the server-side rate limiting and it causes an ungraceful handling.

Fix this issue and make the server handle it gracefully by making the code wait until the timeout requirements are satisfied.

The root issues was that accessing
community.com/profiles/{steamId64}/inventory/json/730/2?count=1000

has a very restrictive rate-limit (3-4 request per minute unauthenticated, authenticated 1 every 8s).

This was solved by reducing the responsibilities of the adapter: it does not need to seek out an item based on inventory and properties alone, it receives a tradeURL and and an inspectLink and validates based on those so the onus is on the caller to identify the inspectLink before asking the oracle to confirm the existence and match it against the buyer's tradeURL steamId64