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

Emergency Breaking API Change #208

Closed
jhgg opened this issue Jan 13, 2017 · 16 comments

Comments

@jhgg
Copy link
Member

commented Jan 13, 2017

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 if you send it a message ID that is too old.

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

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

  • silently fail old message deletes
  • deploy APIs (which will add the error)
  • update docs.
@foxbot

This comment has been minimized.

Copy link
Contributor

commented Jan 13, 2017

You guys are doing God's work, keep it up. 👍

@LaxSlash

This comment has been minimized.

Copy link
Contributor

commented Jan 13, 2017

Good job tracking down the issue. 👍

@Waspyeh

This comment has been minimized.

Copy link

commented Jan 13, 2017

Awesome work guys

@MasterChief-John-117

This comment has been minimized.

Copy link

commented Jan 13, 2017

No messages can be deleted with a bot, even messages sent within the last hour.

EDIT: Issue fixed now

abalabahaha added a commit to abalabahaha/eris that referenced this issue Jan 13, 2017

Reject client.deleteMessages if it tries to delete a >2 week old mess…
…age. (#163)

* Reject client.deleteMessages if it tries to delete a >2 week old message.
- As per discordapp/discord-api-docs#208

* Requested changes
- Remove parseInt
- Precompute 2^22
- Change rejection message

* Removed braces as requested
- (╯°□°)╯︵ ┻━┻

* More requested changes
- ABAL I SWEAR
@jhgg

This comment has been minimized.

Copy link
Member Author

commented Jan 13, 2017

When I pushed this out, I deleted a line of code that actually broke bulk deletes entirely. Whoops.

It's fixed now 👌

abalabahaha added a commit to abalabahaha/eris that referenced this issue Jan 13, 2017

Reject deleteMessages for >2 week old messages (#163)
* Reject client.deleteMessages if it tries to delete a >2 week old message.
- As per discordapp/discord-api-docs#208

* Requested changes
- Remove parseInt
- Precompute 2^22
- Change rejection message

* Removed braces as requested
- (╯°□°)╯︵ ┻━┻

* More requested changes
- ABAL I SWEAR

zajrik added a commit to zajrik/pickle-mod that referenced this issue Jan 13, 2017

Update ClearLogs command
bulk_delete endpoint got changed in a manner that potentially breaks the command. This is faster anyway. I'll update to the channel purge method whenever it's added to the api. See: discordapp/discord-api-docs#208

Fuyukai added a commit to Fuyukai/curious that referenced this issue Jan 13, 2017

@AraHaan

This comment has been minimized.

Copy link

commented Jan 13, 2017

🤦‍♂ Well there goes my fun with bulk delete.

@shkkmo

This comment has been minimized.

Copy link

commented Mar 2, 2018

Is there a issue open for 'introducing a proper "purge channel" endpoint at some point in the future'? Even if this is just something for the UI so I can get rid of old stuff manually

@jhgg

This comment has been minimized.

Copy link
Member Author

commented Mar 2, 2018

We have no plans. I recommend clone channel -> then delete the old one.

@jhgg jhgg reopened this Mar 2, 2018

@jhgg jhgg closed this Mar 2, 2018

@shkkmo

This comment has been minimized.

Copy link

commented Mar 4, 2018

The documentation currently says "An endpoint will be added in the future to prune messages older than 2 weeks from a channel."

I don't see any api endpoint for cloning a channel, what are you talking about?

@MinnDevelopment

This comment has been minimized.

Copy link
Contributor

commented Mar 4, 2018

You can create a channel with the same properties

@SomeoneCares11

This comment has been minimized.

Copy link

commented Mar 4, 2018

@MinnDevelopment but channel_id will change, so u need to edit your bots properties too

@MinnDevelopment

This comment has been minimized.

Copy link
Contributor

commented Mar 4, 2018

Since the bot is performing the update that should not be an issue.

@shkkmo

This comment has been minimized.

Copy link

commented Mar 4, 2018

So the only solution to bulk delete old message is to completely recreate the channel and re-configure all integrations that use it? Won't this also remove any notification settings users have and break all invites and links to it? That's pretty unfortunate.

At the very least, the documentation should be updated to no longer indicate that a solution is coming for this.

@SomeoneCares11

This comment has been minimized.

Copy link

commented Mar 4, 2018

@shkkmo Time ago, you can't delete default channel, and everyone mass deleting messages - that why they said
An endpoint will be added in the future to prune messages older than 2 weeks from a channel.
At least now you can recreate that channel, but i agree with you it is not solution.

@macdja38

This comment has been minimized.

Copy link
Contributor

commented Mar 4, 2018

Through a bot if your bot has the right permissions you could shift the webhooks to target the new channel before deleting the old one? That would probably solve a significant portion of your integration issues.

Still deletes invite links, user notification settings (I think)...

@davefrassoni

This comment has been minimized.

Copy link

commented Aug 7, 2019

Workaround for performance issues: add visible flag in messages and show only those with flag on. Then on low activity times perform background cleaning tasks.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Projects
None yet
You can’t perform that action at this time.