element-hq / element-hq/element-web

Element-R: Unable to verify a device which has outstanding outgoing secret requests

Open
#27,805 0 comments 3 reactions 0 assignees View on GitHub
A-E2EE A-E2EE-SAS-Verification A-Element-R O-Uncommon S-Major T-Defect
Dominant language
TypeScript
Stars
13.5k
Forks
2.8k
PR merge metrics
PR metrics pending

Description

STR:
* Sign in on a new device
* Verify against a device which, for some reason, does not have a copy of the private cross-signing keys. (It's not entirely clear how to get into this situation; one way to do it might be to verify against another device which doesn't correctly implement secret sharing, or one which falls off the internet just after verifying. Alternatively, https://github.com/element-hq/element-web/issues/27806).
* The new device is not verified, and nor does it receive the cross-signing keys. So far, this is https://github.com/element-hq/element-web/issues/27655.
* Verify again, against a properly-verified device.

It still doesn't work. In other words, the new device was permanently broken by the attempt to verify against the broken device. This is a *very* poor experience.

In the console, there is this error:

```
17:06:15.181 ERROR matrix_sdk_crypto::machine: Error handling a verification event: Backend(DomException { code: 0, name: "ConstraintError", message: "A mutation operation in the transaction failed because a constraint was not satisfied." })
at /home/rav/work/matrix-rust-sdk/crates/matrix-sdk-crypto/src/machine.rs:1095
in matrix_sdk_crypto::machine::receive_to_device_event with sender="@a:xps9320.sw1v.org" event_type="m.key.verification.done"
in matrix_sdk_crypto::machine::receive_sync_changes
```

I think what's happening is that the database already contains an outgoing secret request; then when the new verification succeeds, we try to create a new secret request. This causes the database consistency error, and, since we're trying to persist the verification state in the same transaction, that also fails.

Contributor guide

Open the contributing guide

Assessment

This issue has not been assessed yet.

Get new issues in your inbox

A short digest of beginner-friendly GitHub issues.