sergun Posted May 30, 2020 Report Posted May 30, 2020 (edited) hello there, i have a queue system for offers which allows maximum 60 seconds for an offer to get processed & accepted (gets queued again if requests fail somehow) but sometimes, after accepting an offer with the acceptConfirmationForObject() method, the callback takes really long to get triggered or it doesn't get triggered at all while the offer sucessfully got accepted within in seconds after calling the function. sometimes, it just works fine and gets triggered after accepting as it should be. is there anything i can do to fix this unreliability? Edited May 30, 2020 by sergun Quote
vrtgn Posted May 30, 2020 Report Posted May 30, 2020 What is your code? You may not be error handling. Quote
sergun Posted May 30, 2020 Author Report Posted May 30, 2020 (edited) 2 hours ago, vrtgn said: What is your code? You may not be error handling. I do. Mostly, API doesn't response in time and I get timeout error from my queue system. Sometimes, I get a 403. Offers always get successfully accepted though. Also, I just realized that i was mentioning offer.accept method, not 2fa confirmation. Been a while since I touched my code, sorry for confusion. So, it's a steamcommunity module related problem. I meant the acceptConfirmationForObject method, doesn't response in time. function confirm2FA(offerID) { return new Promise((resolve, reject) => { community.acceptConfirmationForObject(config.get('steam').identitySecret, offerID, function (err) { if (err) reject('Offer confirmation 2FA: ' + err); } else { resolve(true); // Offer is confirmed by 2FA } }); }); } Also, I just read that adding a small delay between accepting the offer and confirming 2FA would be better. I'll try this. Just tried adding some delay, didn't change much. It seems that 2FA confirmation takes some time. Edited May 30, 2020 by sergun Quote
Dr. McKay Posted May 30, 2020 Report Posted May 30, 2020 This is just how Steam works, sadly. When you confirm an incoming trade offer, the confirmation request doesn't respond until all items have been exchanged. If a trade offer contains many items, it's very possible that the request will time out (30 seconds) before all items have been exchanged. In this situation, the trade will still complete in the background. sergun 1 Quote
sergun Posted May 30, 2020 Author Report Posted May 30, 2020 23 minutes ago, Dr. McKay said: This is just how Steam works, sadly. When you confirm an incoming trade offer, the confirmation request doesn't respond until all items have been exchanged. If a trade offer contains many items, it's very possible that the request will time out (30 seconds) before all items have been exchanged. In this situation, the trade will still complete in the background. Thank you, I need to confirm that trade successfully got accepted because I'm keeping stats. Should i watch receivedOfferChanged event for this purpose, instead of chaining everything? Quote
Dr. McKay Posted May 30, 2020 Report Posted May 30, 2020 Yes, receivedOfferChanged should be your primary way to see if a trade was completed. sergun 1 Quote
Recommended Posts
Join the conversation
You can post now and register later. If you have an account, sign in now to post with your account.
Note: Your post will require moderator approval before it will be visible.