matrix-org / matrix-appservice-discord

A bridge between Matrix and Discord.
Apache License 2.0
798 stars 149 forks source link

Bridge crashes constantly within better-discord.js #789

Open turt2live opened 2 years ago

turt2live commented 2 years ago

Stacks like this constantly appear (sometimes in different places, but always complaining that it can't read cache of undefined):

/node_modules/better-discord.js/src/client/actions/Action.js:27
    const existing = manager.cache.get(id);
                             ^
TypeError: Cannot read property 'cache' of undefined
    at MessageUpdateAction.getPayload (/node_modules/better-discord.js/src/client/actions/Action.js:27:30)
    at MessageUpdateAction.getMessage (/node_modules/better-discord.js/src/client/actions/Action.js:55:12)
    at MessageUpdateAction.handle (/node_modules/better-discord.js/src/client/actions/MessageUpdate.js:10:28)
    at Object.module.exports (/node_modules/better-discord.js/src/client/websocket/handlers/MESSAGE_UPDATE.js:6:57)
    at WebSocketManager.handlePacket (/node_modules/better-discord.js/src/client/websocket/WebSocketManager.js:391:31)
    at WebSocketShard.onPacket (/node_modules/better-discord.js/src/client/websocket/WebSocketShard.js:451:22)
    at WebSocketShard.onMessage (/node_modules/better-discord.js/src/client/websocket/WebSocketShard.js:308:10)
    at WebSocket.onMessage (/node_modules/ws/lib/event-target.js:125:16)
    at WebSocket.emit (events.js:400:28)
    at Receiver.receiverOnMessage (/node_modules/ws/lib/websocket.js:797:20)

These errors are fatal and have existing for years, however in the last 2 weeks it's gone from once a day to once every 3-5 minutes. This is causing message loss.

turt2live commented 2 years ago

It appears this is related to edits from a random music bot in the wild. Unsure what type of channel it's in because it's not bridged, but it's a thing.

This might be solved with a library update.