Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Lots of "Mismatched room_id for inbound group session" UTDs in threads #22094

Closed
robintown opened this issue May 6, 2022 · 9 comments · Fixed by matrix-org/matrix-js-sdk#2505
Assignees
Labels
A-E2EE A-Threads O-Uncommon Most users are unlikely to come across this or unexpected workflow S-Major Severely degrades major functionality or product features, with no satisfactory workaround T-Defect Z-Rageshake Has attached rageshake (not for log submission process) Z-UISI Unable to decrypt errors

Comments

@robintown
Copy link
Member

robintown commented May 6, 2022

Steps to reproduce

Be in encrypted rooms where others are using threads heavily

Outcome

What did you expect?

No UTDs

What happened instead?

Threaded messages occasionally show up as "** Unable to decrypt: Error: Mismatched room_id for inbound group session (expected !ELvLSzljqBuAwjdBWx:t2l.io, was undefined) **"

Operating system

NixOS unstable

Browser information

Firefox 99.0.1

URL for webapp

develop.element.io

Application version

Element version: 9cb0185-react-e97536ef964b-js-6b5f4aa0a9c1 Olm version: 3.2.8

Homeserver

Synapse 1.58.0

Will you send logs?

Yes

@robintown robintown added T-Defect S-Major Severely degrades major functionality or product features, with no satisfactory workaround A-E2EE Z-Rageshake Has attached rageshake (not for log submission process) Z-UISI Unable to decrypt errors O-Uncommon Most users are unlikely to come across this or unexpected workflow A-Threads labels May 6, 2022
@markiceman
Copy link

I have similar problem.

Element 1.10.12

Operating system: Windows

Browser: Firefox for Web version, Element desktop - both have the same problem

Homeserver: Synpase 1.58.1

Last message in thread in encrypted room is unreadable:

obrazek

This is OK with Element 1.10.11 or Mobile App. It is problem with Element 1.10.12 only.

If I disable threads, message is readable.

Another screenshot with example:

obrazek

@uhoreg
Copy link
Member

uhoreg commented May 20, 2022

It looks like Element is losing the room_id on some messages in threads, for some reason. If I "view source" on these undecryptable messages, then it shows me a blank Room ID

image

and expanding the "Original event source" shows no room_id field. But it obviously has a room ID, or at least had a room ID, somewhere along the line, since it got put in a room.

Is it possible that the event object gets passed to a function that removes the room_id field somehow?

@t3chguy
Copy link
Member

t3chguy commented May 20, 2022

This sounds very similar to the other threads issue which has thread.room is undefined/null

@flyingcakes85
Copy link

In case it matters, it just see this issue after I logged out and logged in.

@uhoreg
Copy link
Member

uhoreg commented Jun 3, 2022

It seems to happen mainly on the last message in a thread. Maybe there's a difference in backfilled messages vs messages from sync? Or something related to getting the megolm session before or after we get the message?

@Wendell250
Copy link

Happened to me today as well.

I wrote a message to a thread (on encrypted channel) and switched to another channel.
But when I came back the last message in the thread was replaced with this error.

Clearing cache and restarting Element didn't fix it.

Element desktop: 1.10.13

@ZReC
Copy link

ZReC commented Jun 28, 2022

It's happening to me every now and then.. only in threads. Sadly, I didn't find a consistent setup to trigger the glitch
image

@duxovni
Copy link
Contributor

duxovni commented Jul 7, 2022

This isn't a real solution for the underlying issue, but as an interim fix while it's being investigated: the codepath throwing that error gets skipped if the provided room ID is null: https://github.com/matrix-org/matrix-js-sdk/blob/develop/src/crypto/OlmDevice.ts#L1066-L1073 Would it be reasonable to also skip it if the room ID is undefined?

@duxovni
Copy link
Contributor

duxovni commented Jul 7, 2022

A tentative theory about what's actually going wrong:

duxovni added a commit to matrix-org/matrix-js-sdk that referenced this issue Jul 8, 2022
…ync (#2505)

Events returned by the `/sync` endpoint, including relations bundled with other events, may have their `room_id`s stripped out. This causes decryption errors if the IDs aren't repopulated.

Fixes element-hq/element-web#22094.
dbkr added a commit to matrix-org/matrix-js-sdk that referenced this issue Jul 12, 2022
* Send call version `1` as a string (#2471)

* test typescriptification - backup.spec (#2468)

* renamed:    spec/unit/crypto/crypto-utils.js -> spec/unit/crypto/crypto-utils.ts

* ts fixes in crypto-utils

* renamed:    spec/unit/crypto/backup.spec.js -> spec/unit/crypto/backup.spec.ts

* ts fixes in backup.spec

* remove fit

* remove debug

* Prepare changelog for v19.0.0-rc.1

* v19.0.0-rc.1

* Update jest monorepo (#2476)

Co-authored-by: renovate[bot] <29139614+renovate[bot]@users.noreply.github.com>

* Update all (#2475)

Co-authored-by: renovate[bot] <29139614+renovate[bot]@users.noreply.github.com>

* Update dependency @types/jest to v28 (#2478)

Co-authored-by: renovate[bot] <29139614+renovate[bot]@users.noreply.github.com>

* Fix call.collectCallStats() (#2480)

Regressed by #2352
(you can just use RTCStatsReport as an iterator directly (which
was was what that code was doing before) which uses entries(
which gives you key/value pairs, but using forEach gives you just
the value.

* Go back to forEach in collectcallstats (#2481)

Older typescript library doesn't know about .values() on the stats
object, so it was failing in react sdk which had an older typescript.
matrix-org/matrix-react-sdk#8935 was an
attempt to upgrade it but did not seem to be helping on CI, despite
being fine locally.

* Update babel monorepo to v7.18.6 (#2477)

Co-authored-by: renovate[bot] <29139614+renovate[bot]@users.noreply.github.com>

* Expose KNOWN_SAFE_ROOM_VERSION (#2474)

* Fix return type on funcs in matrixClient to be optionally null (#2488)

* Update pull_request.yaml (#2490)

* Lock file maintenance (#2491)

Co-authored-by: renovate[bot] <29139614+renovate[bot]@users.noreply.github.com>

* Prepare changelog for v19.0.0

* v19.0.0

* Resetting package fields for development

* Improve VoIP integrations testing (#2495)

* Remove MSC3244 support (#2504)

* Actually store the identity server in the client when given as an option (#2503)

* Actually store the identity server in the client when given as an option

* Update requestRegisterEmailToken to a modern spec version too

* Properly re-insert room ID in bundled thread relation messages from sync (#2505)

Events returned by the `/sync` endpoint, including relations bundled with other events, may have their `room_id`s stripped out. This causes decryption errors if the IDs aren't repopulated.

Fixes element-hq/element-web#22094.

* Remove `setNow` from `realtime-callbacks.ts` (#2509)

Signed-off-by: Šimon Brandner <simon.bra.ag@gmail.com>

* Remove dead code (#2510)

* Don't crash with undefined room in `processBeaconEvents()` (#2500)

* Add a basic PR checklist for all PRs (#2511)

It'll be mildly annoying for core developers who have to constantly remove or edit this, but it'll also serve as a good reminder to do these things.

Note that signoff is not required for core developers.

* Fix tests

Co-authored-by: Šimon Brandner <simon.bra.ag@gmail.com>
Co-authored-by: Kerry <kerrya@element.io>
Co-authored-by: RiotRobot <releases@riot.im>
Co-authored-by: renovate[bot] <29139614+renovate[bot]@users.noreply.github.com>
Co-authored-by: Michael Weimann <michaelw@matrix.org>
Co-authored-by: texuf <texuf.eth@gmail.com>
Co-authored-by: Michael Telatynski <7t3chguy@gmail.com>
Co-authored-by: Travis Ralston <travisr@matrix.org>
Co-authored-by: Faye Duxovni <fayed@element.io>
su-ex added a commit to SchildiChat/matrix-js-sdk that referenced this issue Aug 1, 2022
* Remove MSC3244 support ([\matrix-org#2504](matrix-org#2504)).
* `room` now exports `KNOWN_SAFE_ROOM_VERSION` ([\matrix-org#2474](matrix-org#2474)).
* Don't crash with undefined room in `processBeaconEvents()` ([\matrix-org#2500](matrix-org#2500)). Fixes matrix-org#2494.
* Properly re-insert room ID in bundled thread relation messages from sync ([\matrix-org#2505](matrix-org#2505)). Fixes element-hq/element-web#22094. Contributed by @duxovni.
* Actually store the identity server in the client when given as an option ([\matrix-org#2503](matrix-org#2503)). Fixes element-hq/element-web#22757.
* Fix call.collectCallStats() ([\matrix-org#2480](matrix-org#2480)).
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
A-E2EE A-Threads O-Uncommon Most users are unlikely to come across this or unexpected workflow S-Major Severely degrades major functionality or product features, with no satisfactory workaround T-Defect Z-Rageshake Has attached rageshake (not for log submission process) Z-UISI Unable to decrypt errors
Projects
None yet
Development

Successfully merging a pull request may close this issue.

8 participants