matrix-rust-sdk icon indicating copy to clipboard operation
matrix-rust-sdk copied to clipboard

`SasState::Started` does not allow to know who started the SAS verification

Open zecakeh opened this issue 6 months ago • 0 comments

The SasState::Started state occurs when either party started the SAS verification. However it is important to know whether we started it, because, when we use SasVerification::changes, if we receive the state and the other party started it, we need to accept it so the verification can continue.

I thought that's what SasVerification::we_started was for, but it's actually the same value as VerificationRequest::we_started, which is the party that sent the verification request, not the party that started the SAS verification. That makes sense if the use case is to drop VerificationRequest when the SasVerification starts and we want to keep the same API.

I am wondering which solution is more acceptable:

  1. Keep a boolean internally and expose it in a method, e.g. SasVerification::we_started_sas().
  2. Use different variants according to whether we or the other party started it. This is the solution in other cases were it matters who sent what: VerificationRequestState::Created vs VerificationRequestState::Requested and QrVerificationState::Reciprocated vs QrVerificationState::Scanned.

zecakeh avatar Dec 26 '23 11:12 zecakeh