Open Fox32 opened 1 year ago
https://github.com/matrix-org/matrix-spec-proposals/pull/2762 is the spec for this which doesn't explicitly state either way what should happen with encrypted events (although the sending part would suggest they should be forwarded after decryption if the widget is to be unaware of encryption).
@dbkr the related MSC is https://github.com/matrix-org/matrix-spec-proposals/pull/3819, I already added a comment there that this behavior needs to be clarified.
Steps to reproduce
sendToDevice
Outcome
What did you expect?
Both messages can be received by another device.
What happened instead?
Only the unencrypted event is received.
I already analyzed it a bit more: The issue is that the code flow for encrypted and unencrypted devices is different. In
StopGapWidgetDriver
, for unencrypted messages the content parameter ofsendToDevice
is forwarded as-is together with the event type, but the event type is not forwarded at all for encrypted messages. I could verify that on the receiver side, the message is received without any eventtype
, neither is the content of the message correct, because the payload is not under thecontent
property, but applied to the top level.I think the correct way would be to construct a new payload object inside
StopGapWidgetDriver
that has a top leveltype
and all content is placed incontent
. I could verify that doing it manually works:Fixing this issue though might be a breaking change for existing widgets that use this API. Especially for Element Call. Element Call itself already takes care of this behavior and would break if the issue is fixed.
Operating system
macOS
Browser information
Chrome
URL for webapp
develop.element.io
Application version
Element version: a26be2665fc1-react-2da98a6024ff-js-16672b3d0cad Olm version: 3.2.12
Homeserver
matrix.org
Will you send logs?
No