wurli/tidyverse-dev-bot

Failures cause duplicates

Closed this issue · 0 comments

wurli commented

If the process fails after tweets are posted, the whole process will fail, meaning tweets will be posted again next time. If this fails again then this can result in a loop of updates getting repeatedly posted.

This happened when a tonne of changes were made to the dplyr README before a release (tidying up). I think the volume of tweets this generated led to a failure, and has done so on every subsequent run (when the full bunch of updates is attempted to be posted).

Ways to fix this:

  • Add some tryCatch() stuff to make it almost impossible for things to fail on the R-side if posting has succeeded. This should be done anyway, because if the exact text of a tweet is attempted to be posted a second time, this will (seemingly) always fail.
  • Test if the text of a tweet has already been posted (using {rtweet}) before posting... More like avoiding failures in the first place
  • Only post the first, say, 10 tweets generated in a run. This would at least mean the next bunch would be deferred until the following run.