element-hq / element-hq/element-web
Error message for "Room was previously configured to use encryption, but is no longer." is now swallowed rather than presented to the user
- Dominant language
- TypeScript
- Stars
- 13.5k
- Forks
- 2.8k
- PR merge metrics
- PR metrics pending
Description
### Steps to reproduce
Go to an e2ee room whose m.room.encryption event has been reset and send a message. (In this instance, it hasn't deliberately been reset, but the client has got confused)
### What happened?

The relevant error ends up in the JS console however:
```
sendEvent of type m.room.message in !kGLhQmvYrFWnVNxhBx:matrix.org with txnId m1628524623349.189
16:57:03.366 rageshake.js?432e:65 setting pendingEvent status to encrypting in !kGLhQmvYrFWnVNxhBx:matrix.org event ID ~!kGLhQmvYrFWnVNxhBx:matrix.org:m1628524623349.189 -> undefined
16:57:03.383 rageshake.js?432e:65 Error sending event Error: Room was previously configured to use encryption, but is no longer. Perhaps the homeserver is hiding the configuration event.
at Crypto.encryptEvent (webpack-internal:///164:2598:13)
at MatrixClient.encryptEventIfNeeded (webpack-internal:///118:3151:24)
at eval (webpack-internal:///118:3057:38)
consoleObj. @ rageshake.js?432e:65
16:57:03.384 rageshake.js?432e:65 setting pendingEvent status to not_sent in !kGLhQmvYrFWnVNxhBx:matrix.org event ID ~!kGLhQmvYrFWnVNxhBx:matrix.org:m1628524623349.189 -> undefined
```
So this is a regression where we should be showing the human-facing error to the user, but we're not any more since we redesigned the error UI a few months ago.
### What did you expect?
Error should be presented to the user in the UI like we used to.
### Operating system
macOS
### Application version
nightly today
### How did you install the app?
_No response_
Contributor guide
Research direction
Start by tracing the send flow from MatrixClient.encryptEventIfNeeded to Crypto.encryptEvent, using the reported console error as the reproduction point. Then inspect the redesigned error UI and the pending-event transition to not_sent. Done means this encryption error is presented to the user in the UI rather than only logged to the console.
Written by the indexing model from the issue text.
Assessment
- Tech stack
- typescript
- Domain
- frontend
- Issue type
- Bug
- Difficulty
- 3/5
- Estimated time
- 1-2 days
- Activity status
- Stale
- Clarity
- Mostly clear
- Newbie friendliness
- 35/100