Repository navigation
Stop an edit of an uncached message from taking the bot down - #12
Merged
Merged
Conversation
An edit or delete of a message that is not in the cache arrives as a partial with author null. The logging handlers read author.id and threw. discord.js turns that into an error event on the client, and with no listener Node exits the process: twelve restarts in the last seven days. Both handlers now skip a message without an author, and every client gets an error listener so a failing handler is logged instead of ending the process.
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Add this suggestion to a batch that can be applied as a single commit.This suggestion is invalid because no changes were made to the code.Suggestions cannot be applied while the pull request is closed.Suggestions cannot be applied while viewing a subset of changes.Only one suggestion per line can be applied in a batch.Add this suggestion to a batch that can be applied as a single commit.Applying suggestions on deleted lines is not supported.You must change the existing code in this line in order to create a valid suggestion.Outdated suggestions cannot be applied.This suggestion has been applied or marked resolved.Suggestions cannot be applied from pending reviews.Suggestions cannot be applied on multi-line comments.Suggestions cannot be applied while the pull request is queued to merge.Suggestion cannot be applied right now. Please check back later.
An edit or delete of a message that is not in the cache arrives as a partial with
authornull.onMessageEditandonMessageDeleteinbots/events/handlers/logging.jsreadauthor.idand threw. discord.js turns a rejected handler into anerrorevent on the client, and with no listener Node exits the whole process. The server log shows twelve restarts in the last seven days, the latest at 12:07 today:main.jsgets anEvents.Errorlistener, so a failing handler is logged instead of ending the process.Tests: section L in the harness sends a partial edit and delete through both handlers and checks for the listener. With the old guard both cases fail.
npm test: 180 passed.