Skip to content

Say when a cleartext client drops an encrypted room's events - #31

Open
TroyHernandez wants to merge 2 commits into
mainfrom
encrypted-room-notice
Open

TroyHernandez wants to merge 2 commits into
mainfrom
encrypted-room-notice

Conversation

@TroyHernandez

Copy link
Copy Markdown
Contributor

Makes a silent failure visible: a Matrix client built without e2ee now says so when an encrypted room's events reach it.

What

chat_poll() on a client with e2ee = FALSE emits a message naming the room the first time it sees an m.room.encrypted event there, once per room for the life of the client:

chat.api: room !abc:example.org is encrypted and this client has no e2ee; its messages are dropped

An e2ee client decrypts those events instead and never raises it. The e2ee parameter's documentation says what happens when it is off.

Why

A cleartext client in an encrypted room receives m.room.encrypted events it cannot read, and the text extractor skips them. Nothing in the poll mentioned them, so a bot invited into such a room looked dead: it joined, and every message after that vanished without a line in its log, while it kept answering in its unencrypted rooms. Clients enable encryption on private rooms by default, so this is an easy state to end up in. One message in the log the operator is already reading turns a dead-bot hunt into a config change.

Verification

  • New block in test_matrix.R: a seamed poll over one encrypted and one cleartext room says it once, names only the encrypted room, stays quiet on the next poll of the same room, speaks again for a room first seen encrypted later, and says nothing for an e2ee client or an empty sync.
  • Full suite from a scratch library, and tinypkgr::check(): results in the first comment.

@TroyHernandez

Copy link
Copy Markdown
Contributor Author

Verification for a9ebfe6 + 5fb8a62:

  • Full suite from a scratch library: 1479 results, 0 failures (test_matrix.R 530, including the new block).
  • tinypkgr::check() against the same library: Status: 1 NOTE, the CRAN incoming feasibility note ("Days since last update: 1"); the tests step ran tinytest.R OK. The first run stopped at "Package suggested but not available: 'telegram'", which is this host missing the suggested package, not the change; the rerun had it installed in the scratch library.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

1 participant