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

Update bulk-delete #320

Closed
zet4 opened this issue Jan 28, 2017 · 2 comments
Closed

Update bulk-delete #320

zet4 opened this issue Jan 28, 2017 · 2 comments
Milestone

Comments

@zet4
Copy link

zet4 commented Jan 28, 2017

Currently restapi uses old now deprecated endpoint /bulk_delete, the new endpoint is /bulk-delete.
Also bulk-delete won't delete messages older then 2 weeks now, probably should handle that on the side of the library somehow.

@bwmarrin bwmarrin added this to the v0.17.0 milestone Apr 18, 2017
@bwmarrin bwmarrin modified the milestones: v0.18.0, v0.17.0 Sep 5, 2017
@CarsonHoffman
Copy link
Collaborator

@bwmarrin would you have an opinion on how the library should handle a situation like the OP mentioned? I imagine we wouldn't want to be sending out (up to) 100 individual message delete calls for messages older than 2 weeks, but I'm also not sure if handling this situation is within the scope of the library at all, as the functionality is within the API itself. The other way I would think to do it is returning an error if the call tries to delete anything older than 2 weeks, but again, I'm not sure if that's along with the spirit of the library.

@Hinara
Copy link
Contributor

Hinara commented Oct 8, 2017

From Discord API Channel

Blueeyeswhitefullmetalgarurumon - 01/13/2017
Emergency Breaking API Change
The bulk_delete endpoint will no longer delete messages older than 2 weeks.

This was not a decision made lightly, as I've finally narrowed down the root cause of the recent API stability issues to people using bulk delete to purge channels with extensive message history, creating excessive table fragmentation within our cassandra cluster.

We'll be introducing a proper "purge channel" endpoint at some point in the future - which will be able to delete old messages without creating excessive table fragmentation (we already have a plan on how to do so).

For now, bulk delete requests will silently discard older messages when attempting to delete. The next time we roll APIs, the API endpoint will fail with a bad request, with error code: 50034.

You can figure out the minimum allowed snowflake with the following code:

long((time.time() - 14 * 24 * 60 * 60) * 1000.0 - 1420070400000L) << 22

discord/discord-api-docs#208

So We need to update bulk delete but well older message will stay in trouble for deletion as the "purger channel" endpoint still no there for now.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

4 participants