Prerequisites
Description
After editing an encrypted message while encryption remains enabled, the edited message displays a decryption error. Restarting GoofCord causes the same edited message to decrypt correctly.
I intend to work on a fix and submit a PR.
Steps to Reproduce
- Enable message encryption and configure an encryption password.
- Enable encryption using the chat button.
- Send an encrypted message.
- Keep encryption enabled.
- Edit the message and save the edit.
- Observe the displayed message.
- Restart GoofCord and view the message again.
Expected Behavior
The edited encrypted message should decrypt immediately when its MESSAGE_UPDATE event is processed.
Actual Behavior
Immediately after the edit, GoofCord displays:
Decryption failed: Cannot read properties of undefined (reading 'length')
After restarting GoofCord, the edited message loads and decrypts correctly.
Screenshots
The encrypted message successfully decrypted before editing:

The decryption error immediately after editing:

The edited message successfully decrypted after restarting GoofCord:

Operating System
Windows 10
GoofCord Version
2.2.2
Installation Method
Installer from GitHub Releases (.exe, .dmg, .deb, .rpm, etc.)
Additional Information
Installed using the Windows x64 .exe installer.
The outgoing pre-edit hook receives a valid channelId and successfully encrypts the edit. The failure occurs while processing the incoming MESSAGE_UPDATE.
The current handler calls:
dispatch.message.content = GoofCord.decryptMessage(
dispatch.message.content,
dispatch.channelId,
);
The error is consistent with dispatch.channelId being undefined when passed through the generated WASM string wrapper. The updated message itself contains dispatch.message.channel_id, which should be preferred or used as a fallback.
History loading uses a different dispatch path with a valid channel ID, explaining why restarting allows the same ciphertext to decrypt.
Prerequisites
Description
After editing an encrypted message while encryption remains enabled, the edited message displays a decryption error. Restarting GoofCord causes the same edited message to decrypt correctly.
I intend to work on a fix and submit a PR.
Steps to Reproduce
Expected Behavior
The edited encrypted message should decrypt immediately when its
MESSAGE_UPDATEevent is processed.Actual Behavior
Immediately after the edit, GoofCord displays:
Decryption failed: Cannot read properties of undefined (reading 'length')After restarting GoofCord, the edited message loads and decrypts correctly.
Screenshots
The encrypted message successfully decrypted before editing:
The decryption error immediately after editing:
The edited message successfully decrypted after restarting GoofCord:
Operating System
Windows 10
GoofCord Version
2.2.2
Installation Method
Installer from GitHub Releases (.exe, .dmg, .deb, .rpm, etc.)
Additional Information
Installed using the Windows x64
.exeinstaller.The outgoing pre-edit hook receives a valid
channelIdand successfully encrypts the edit. The failure occurs while processing the incomingMESSAGE_UPDATE.The current handler calls:
The error is consistent with
dispatch.channelIdbeing undefined when passed through the generated WASM string wrapper. The updated message itself containsdispatch.message.channel_id, which should be preferred or used as a fallback.History loading uses a different dispatch path with a valid channel ID, explaining why restarting allows the same ciphertext to decrypt.