Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
Ensure that we're not creating the same session twice
Usually it's impossible to create a Olm session from a pre-key message twice. The one-time key that should be used for the 3DH step will be used up and we're going to throw a `MissingOneTimeKey` error. This used to be true and unproblematic until we added fallback keys, these keys will not get discarded immediately after they have been used once. This means that a pre-key message, for which we already have a Session, but decryption for it fails, might create a new Session overwriting the existing one which will essentially reset the ratchet.
- Loading branch information