DoctorMcKay / node-steam-tradeoffer-manager

Simple and sane Steam trade offer management
https://dev.doctormckay.com/forum/9-node-steam-tradeoffer-manager/
MIT License
520 stars 134 forks source link

Offer without trade id. #14

Closed connorlurring closed 9 years ago

connorlurring commented 9 years ago

[Error: Offer #721136877 is accepted, but does not have a trade ID]

Error returned when calling offer.getReceivedItems(function(err, items) { ... }

Results in items being undefined.

2c2c commented 9 years ago

is this a rare occurrence?

connorlurring commented 9 years ago

No, happens each time an offer is submitted.

DoctorMcKay commented 9 years ago

That's 100% a Steam issue.

connorlurring commented 9 years ago

Is there any way to retrieve the new asset id other than inventory searching?

DoctorMcKay commented 9 years ago

You could check inventory history. node-steamcommunity has this feature. Not sure if it'll be in there though.

GlebkaF commented 9 years ago

So what are we to do?

if(!this.tradeID) { makeAnError(new Error("Offer #" + this.id + " is accepted, but does not have a trade ID"), callback); return; } How is this even possible? It got offer id after checks for its existence.

2c2c commented 9 years ago

there isn't really an answer if something on steam's end is broken for a period of time

this shouldn't be something persisting though. personally i've never seen it.

if you're asking for tips on how to handle a disaster situation like this in production, something you might want to try is monitoring the change in your own bot's inventory before and after the trade. keep in mind you need some kind of async series management or you have a potential race condition

connorlurring commented 9 years ago

https://gist.github.com/WeeSkilz/6e63955649d77f8151cc Am I right in thinking this is the way I should be trying to get the items?

2c2c commented 9 years ago

misread on my phone, whoops

DoctorMcKay commented 9 years ago

@2c2c He is waiting until either the callback of accept or the event, as getReceivedItems would return a different error if the offer isn't in the Accepted state.

Edit: @WeeSkilz Didn't see your gist. Yes, that's correct.

DoctorMcKay commented 9 years ago

If you check the API directly, does the offer have a trade_id?

connorlurring commented 9 years ago

Using the event allowed access to the trade id. Not sure why though given I was already attpting to access in the callback.

DoctorMcKay commented 9 years ago

I was too quick to blame Steam. Entirely my fault. Fixed in v1.8.4.