Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Ended because API returned an empty page (Fix) #218

Open
wants to merge 2 commits into
base: master
Choose a base branch
from

Conversation

overdosing
Copy link

@overdosing overdosing commented Jun 19, 2021

Fixes the problem regarding API returning an empty page

Summary - Since everything is done in chunks of 25, if the system finds 1-25 messages it will delete them. If it finds 0 messages (but total-offset>0) it will increment the offset by 25 to skip the 25 non-deletable messages and recurse. If (total-offset <= 0) then it will still end.

Incrementing the offset by 1 each time is not ideal because you'll still be traversing huge chunks of dead messages.

I had the original problem described above earlier - I've been running this for several hours now and have deleted thousands of messages with no errors and no API-induced slowdowns.

Credit: PinkyLaRue & larryqiann


This change is Reviewable

@sintrix
Copy link

sintrix commented Jan 7, 2022

funny, i just forked this to write a similar fix for the same issue. merge pl0x!

@Wade-BAV
Copy link

Is there a hope that this is fixed?

@Assistancepls
Copy link

I have the same problem and I have about 30,000 messages left to delete. Is this still being worked on?

Copy link

@JimmyRecardFr JimmyRecardFr left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Reviewed 1 of 1 files at r1.
Reviewable status: :shipit: complete! all files reviewed, all discussions resolved (waiting on @overdosing)

@Wayyllon
Copy link

I had this issue just now, reinstalled it & it still seemed bugged, a workaround for this is to set it to delete all messages prior to the one you started having issues with & it'll function just fine.

@aijorgenson
Copy link
Contributor

This fix may be a bit overkill, please see PR #323

@bugsnitch
Copy link

now how to fix this nothing seems to be working

@victornpb victornpb added the PR missing src files (can't merge) Doesn't contain changes to src files. (Please read CONTRIBUTING) label Mar 9, 2023
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
PR missing src files (can't merge) Doesn't contain changes to src files. (Please read CONTRIBUTING) PR needs further testing
Projects
None yet
Development

Successfully merging this pull request may close these issues.

None yet

9 participants