undiscord icon indicating copy to clipboard operation
undiscord copied to clipboard

[BUG] Unable to delete messages unless I include a new message

Open bad1080 opened this issue 3 years ago • 3 comments

first off: thank you very much for making this tool, it is very much appreciated!

Describe the bug undiscord is unable to delete messages although it is finding them in the search

To Reproduce Steps to reproduce the behavior:

  1. it started with me unfriending someone that i still wanted to delete dm's from (and i deleted roughly 7k messages before this)
  2. now undiscord was unable to perform (understandably so)
  3. added them back to friends (and they accepted the friends request)
  4. undiscord can "see" the left over messages again (which went back to early 2020 at this point, not sure if that matters) but is unable to delete them unless:
  5. i write a new message and include it in the deletion
  6. this is repeatable

Screenshots / Logs with only old messages: Clipboard01 after including 4 new messages: image another one: image

Paste logs here 
(not sure how tbh)

Affects

  • [x] DMs (haven't tested anything else)

System:

  • OS: Windows 10 64bit
  • Browser: Vivaldi 4.1.2369.16 (Stable channel) (64-bit)
  • Tampermonkey

bad1080 avatar Aug 14 '21 20:08 bad1080

The Undiscord userscript should work normally again when you refresh your tab. Either that or try to delete again. Sometimes the Undiscord userscript won't delete all messages the first try. I am not sure why.

ghost avatar Aug 14 '21 21:08 ghost

The Undiscord userscript should work normally again when you refresh your tab. Either that or try to delete again. Sometimes the Undiscord userscript won't delete all messages the first try. I am not sure why.

i tried reloading and triggered the deletion multiple times and found this (step 5) to be the only way to get the process going again edit: i just found another way to get it going by setting the range closer to the date of the messages. w/o = no messages deleted, with it set to 1/1/2019-12/31/2019 = great success edit 2: yet the same doesn't work for 2018

bad1080 avatar Aug 14 '21 21:08 bad1080

This is something i've experienced as well, it stops when it encounters an empty page (which can be any page full of system messages, even if there are more messages beyond that)

The workaround is to edit the script like so line 353:

} else {
    if (total - offset > 0) log.warn('Ended because API returned an empty page.');
    return end();
}

becomes

} else {
    if (total - offset > 0) log.warn('API returned an empty page.');
    if (skippedMessages.length == 0) return end();
    offset += 25;
    return await recurse();
}

That way it only ends when a page is truly empty

ghost avatar Aug 27 '21 17:08 ghost