j0be / PowerDeleteSuite

Power Delete Suite for Reddit
1.68k stars 113 forks source link

Failing to edit comments - rate limit exceeded #36

Closed LewisUD closed 1 year ago

LewisUD commented 1 year ago

Currently trying to bulk edit all previous comments, but it fails and looking at the response from reddit I see lots of

["Looks like you've been doing that a lot. Take a break for 3 seconds before trying again."]

When this response is retrieved the app should either slow down or alert the user to wait before continuing the script

LewisUD commented 1 year ago

Full network response:

{"jquery": [[0, 1, "call", ["#form-t1_h5t4sxl"]], [1, 2, "attr", "find"], [2, 3, "call", [".status"]], [3, 4, "attr", "hide"], [4, 5, "call", []], [5, 6, "attr", "html"], [6, 7, "call", [""]], [7, 8, "attr", "end"], [8, 9, "call", []], [1, 10, "attr", "find"], [10, 11, "call", [".error.RATELIMIT.field-ratelimit"]], [11, 12, "attr", "show"], [12, 13, "call", []], [13, 14, "attr", "text"], [14, 15, "call", ["Looks like you've been doing that a lot. Take a break for 3 seconds before trying again."]], [15, 16, "attr", "end"], [16, 17, "call", []]], "success": false}

nathanielcwm commented 1 year ago

There is a check for errors, but it only happens if the response is not 200. Which doesn't happen when it is rate limited.

mbirth commented 1 year ago

If you have a look at the forks, several users implemented some delays when editing. The last update of this fork was in 2021 with the last release being from 2019. So I don't think it'll ever be fixed here.

j0be commented 1 year ago

Yeah, sadly, that was a low priority fix. Sorry I haven't gotten around to it

dcharles commented 1 year ago

The fork by user "gbf-dtb" has a good example with a sleep. The rate-limiting issue seems to also affect deleting, not just editing. So you'd probably want to add the sleep into both the "edit" and "delete" functions.

dimitri-vs commented 1 year ago

I used the https://github.com/deestan/PowerDeleteSuite fork as a drop in replacement that has a 5 second delay on edits, not sure about deletes.

Veraxus commented 1 year ago

I think this bug is the top reason that "Reddit is undeleting my comments" is trending. Because Reddit returns 200s for rate-limited rejections, PDS tells users that it deleted/edited their comments even when it most definitely did NOT.

I ended up copying the main PDS script into ViolentMonkey and adding a setTimeout around the $.ajax calls, plus some extra handling for response.success = "false". With a timeout of 2000ms I was finally able to confirm that all my content was successfully edited after running for a couple of days straight.

This needs to be THE priority fix right now, as people are trying to delete their content before leaving Reddit by July 1.