Skip to content

Conversation

@MattIPv4
Copy link
Contributor

Please describe the changes this PR makes and why it should be merged:

This fixes #4826 by adding a new client option to set a fixed limit on the edit history stored for each message in the client cache.

This has been tested in production on my bot (where the original memory issue was observed) for roughly a month and seems to be fine.

Status

  • Code changes have been tested against the Discord API, or there are no code changes
  • I know how to update typings and have done so, or typings don't need updating

Semantic versioning classification:

  • This PR changes the library's interface (methods or parameters added)
    • This PR includes breaking changes (methods removed or renamed, parameters moved or removed)
  • This PR only includes non-code changes, like changes to documentation, README, etc.

@MattIPv4 MattIPv4 changed the title Limit message edit history feat(Message): add messageEditHistoryMaxSize to limit stored msg edits Sep 30, 2020
The messageEditHistoryMaxSize client option sets a hard limit for the maximum number of previous versions held in a message when it gets edited.
@MattIPv4
Copy link
Contributor Author

MattIPv4 commented Oct 4, 2020

Fixed the issue with messageUpdate not firing by changing Message#patch to return the old message clone, which can then be used when the event is fired. Method is private, so I assume this can remain minor.

@iCrawl iCrawl merged commit c412cd7 into discordjs:master Oct 17, 2020
GiorgioBrux pushed a commit to GiorgioBrux/discord.js that referenced this pull request Oct 17, 2020
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

Successfully merging this pull request may close these issues.

Excessive memory usage for message

10 participants