DoctorMcKay/node-steam-tradeoffer-manager

Polling running every second when an offer is Active (not accepted or declined)

puntk opened this issue · 4 comments

puntk commented

I'm not sure if this is supposed to happen, but when the script receives an offer and it doesn't act upon it (accept or decline it), the polling runs multiple times, at minimumPollInterval (1 second) interval.

To reproduce: Send a tradeoffer to the script, but not accept or decline it. The polling should continue every second for some time (some times it keeps going, sometimes runs for a couple of times, hence the confusion).

lines marked [DOING POLL] are when the poll is actually done, and passes all poll checks, in polling.js before this.getOffers(). This is the most relevant line. the [realPollInterval] param shows the actual time diff between the last poll and the current one.

doPoll.check happens at around line 30 in polling.js
resetPollTimer happens in the _resetPollTimer() method

https://pastebin.com/iHrRcbji

If this is normal behaviour, allow us to change minimumPollInterval. Currently it's stored in a const, in polling.js

[8:57 AM] McKay: remember that thing where people were reporting they were getting trade offer notifications every second or so?
[8:58 AM] McKay: a bot I sent a trade to was getting that
[8:58 AM] McKay: but then I opened the trade offers page in steam (on my account, not the bot account) and it stopped happening so quickly(edited)

It's probably that, there were at least 3 incindents of this I know of. Manager automatically polls on newTrade notification from steam-user instance.

I remember reporting this (tradeOffers event being emitted every couple seconds) to McKay some time ago. Seems like I'm not the only one?

edit. Here it is:
image

It seems like a bug in Steam that needs to be worked around in steam-user, not here. Could be done by suppressing the event if the count is the same as last time. Given that nobody should be using notification-based polling without also using fallback time-based polling the risk of somehow an offer being accepted at exactly the same time as one comes in resulting in a notification of the same count of offers is minimal, if it's even possible.

Closing this since it doesn't have anything to do with steam-tradeoffer-manager.