smacademic / project-bdf

project-bdf created by GitHub Classroom
2 stars 0 forks source link

Bot processes all identified comments, even if they have already been processed #23

Closed afig closed 5 years ago

afig commented 5 years ago

Describe the bug Currently, the bot processes all comments that contain the specified keyword, but does not take into account whether the comment has already been processed.

To Reproduce Run the bot as-is; all comments that contain !TextifyReddit are processed on every execution.

Expected behavior Each comment is only processed once

Screenshots/Logs N/A

Project information Noticed: Start of M3, existed since start of M2.

Additional context It is necessary to address this bug before allowing the bot to run continuously.

afig commented 5 years ago

Comments already have a unique identifier, so knowing which comments have been processed should be a simple as adding it to a list and checking that list before processing a comment.

The list of comments should persist after restarts of the bot, so it will likely be stored in a local file.

However, a naive solution will likely run into a problem when the bot is scaled out. This should be considered, but is not necessary to address for this issue. (A separate issue can be opened at a later point when performance of this list solution becomes a problem.)

afig commented 5 years ago

A simpler solution may be possible later once issues #24 and #33 are addressed. Rather than having to maintain a list, we can simply only process comments that arrived after the bot has started. However, I will implement the current solution for the time being.