matrix-org / matrix-appservice-discord

A bridge between Matrix and Discord.
Apache License 2.0
785 stars 148 forks source link

Crash when trying to read manager.cache.get(id) in better-discord.js #883

Open Stargirl-chan opened 1 year ago

Stargirl-chan commented 1 year ago

Describe the bug The bridge crashes after a while due to attempting to read undefined properties in the better-discord.js library.

Expected behavior The error should be caught and logged.

OS Infos

OS: FreeBSD 13.0-RELEASE-p13 amd64
matrix-org/matrix-appservice-discord: v3.1.1 (commit: ece29f4)
matrix-org/better-discord.js: commit: 5024781db755259e88abe915630b7d5b3ba5f48f
Conduit: 0.5.0
node: v18.12.1

Additional context Error Log: bridgecachecrash

I report this bug here, as it seems I cannot create issues on: https://github.com/matrix-org/better-discord.js

thetayloredman commented 11 months ago

+1. This issue keeps crashing my bot.

schrmh commented 8 months ago

@Stargirl-chan @thetayloredman Does it only happen when messages get send in voice channels for you two? Cause this seems to be the case for me (maybe the better title for the issue would be: "Each message in a voice channels crashes the bridge"?)

Btw. Stargirl, log in text form is better. I did not find this issue when searching for channel.messages.cache.get nor for MessageCreate.js. I only found it cause I searched for crash a few minutes later after I found out how to repeat the bug for actually writing a report myself... Anyways, my log: Edit: Removed (reason in my next message here; don't want to bring people with that slightly different thing to here directly)

thetayloredman commented 8 months ago

@schrmh I no longer run MASD, so I cannot comment on that anymore. However it may be so. It seemed to happen relatively randomly.

schrmh commented 8 months ago

Actually, I just noticed that the crash is slightly different so I will create a new issue anyways... (ffs father getting on my nerves when I want to write a bug report before going somewhere) Thanks for answering tho.