tf2-automatic icon indicating copy to clipboard operation
tf2-automatic copied to clipboard

Bot manager incorrectly tries to confirm an already confirmed offer

Open ZeusJunior opened this issue 1 year ago • 2 comments

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: image

Bot: image

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

ZeusJunior avatar Aug 14 '24 21:08 ZeusJunior

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.

Nicklason avatar Aug 14 '24 22:08 Nicklason

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

ZeusJunior avatar Aug 14 '24 22:08 ZeusJunior