ian-campbell/Erasure

slow computer causing premature completion of script. dirty hack enclosed.

electronoob opened this issue · 2 comments

in script.js#L36 there is

if (i < myList.length) {
  doOne(i);
}

Due to a slow computer I'm having trouble with the script ending prematurely. Each request for a new list takes almost a second on my machine so I had to either set a stupidly long global delay or manually run the script again repeatedly.

My quick hack is to just add a delay once the list is processed allowing time for my machine to catch up loading and continue.

if (i < myList.length) {
  doOne(i);
}else {
  setTimeout(()=>{
    doOne(0);
  },1000);
}

I don't mind sending in a PR but figured since I'm still waiting to finish deleting comments I will post this issue in case I forget. Besides, only tested on my machine, could blow the planet up or something.

Anyway,
bloody useful script! Thanks for saving me a lot of headache.

okay so turns out, whilst it gets the job done, it does end up in a spammy endless loop when there is just the last comment remaining.

after deleting several years of comments perfectly well, the page looped showing the delete and confirm dialogs rapidly over and over without finally deleting the very last message.

works for me (tm)

previously stated issue is fixed, no longer infinite looping due to the retry, checks comment collection for any visible comments.

myList.length() never changed size after removing comments. elements were just being hidden so needed to confirm if any were still visible or not. if none visible remain then assume finished. however if script was already in the process of iterating through myList and encountered a problem then PAUSE ms and restart the process with doOne(0);