Bot manager incorrectly tries to confirm an already confirmed offer
Is there an existing issue for this?
- [X] I have searched for an existing issue
Expected behavior
The bot manager should not attempt to send another CONFIRM event after a socket hang up
Actual behavior
The bot receives a trade offer and I tell it to accept said trade offer through the bot-manager.
The bot succesfully accepts the offer and emits a confirmation event, I tell it to confirm through the bot-manager.
The bot succesfully confirms the offer, however the bot manager seems to receive a socket hang up in its first attempt to tell the bot to confirm. Leading it to try again. Causing an error as the offer has already been confirmed
Manager:
Bot:
I was told this could be a networking issue, and although the incorrect error event happens frequently it does not happen 100% of the time.
Steps to reproduce
See expected behavior. Just send it an offer
TF2 Automatic version
7.3.1
Projects
- [X] @tf2-automatic/bot
- [X] @tf2-automatic/bot-manager
- [ ] @tf2-automatic/bot-data
- [ ] @tf2-automatic/bot-manager-data
- [ ] @tf2-automatic/bptf-manager
- [ ] @tf2-automatic/bptf-manager-data
- [ ] Other (see below)
Other projects
No response
Additional information
No response
One way to fix this could be to make the bot check the state of an offer before confirming it, but this would slow down accepting confirmations.
A better solution would be to make the bot save that the offer has been confirmed. The bot already stores this information so it should be simple to implement this.
It wouldn't affect speed if it doesn't try to verify this on attempt 0 but yes the bot handling it instead is a better solution