Thursday, May 16, 2019

Changelog 2019-05-16 - Three Fixes

Swap Bot - Now ignores people who tag themselves in favor of other people they tag

Sometimes, when people try to invoke the swap bot on r/funkoswap, they will tag themselves, their trade partner, and the bot rather than just their trade partner and the bot. The bot had some logic to handle ignoring people who tagged themselves and just look for tags of other people, but it had a logic error involving letter casing. A short fix to make everything work in lower case ensures this works properly.

Swap Bot - Now handles exceptions in iterating over inbox messages

The bot would, on occasion, crash during execution when iterating over messages in the inbox. This would cause any message read and marked as read to be lost. By moving the logic of marking a message as read to happen once all messages have been seen in the inbox, we can avoid marking a message as read but not acting on it. This is an extreme edge case that only presents itself on occasion but would cause the bot to miss some tags.

Swap Bot - Correctly determines is one of the commenters is the OP of the post in question

We always want to ensure that at one of the people involved in a confirmation is the original poster for that thread. Previously, this was done by checking the submitter of the parent of the comment the bot was tagged in. This assumed either a top level comment was made or someone replied to a previous discussion. However, there was a case where someone replied to AutoMod instead. Considering AutoMod was not one of the people involved in the trade, this check failed.

Now, we use the .is_submitter field on both comments in question (the tag and the confirmation) to ensure that one of them was made by the submitter of the post.

No comments:

Post a Comment

Hot Cash Give Away Jan 2021

  Hey everyone! Time for another round of Hot Cash codes! Hot Cash ends soon so be sure to use these ASAP! Comment below with the codes you ...