[lib] Restart session when any Olm error is thrown
Summary:
This diff restarts session when any Olm error is thrown by throwing an exception with OLM_ERROR flag set if error occured when decrypting the message.
If flag is included in the exception then the session is reset.
https://linear.app/comm/issue/ENG-9729/session-not-reset-after-getting-bad-message-mac
Test Plan:
- Simulate BAD_MESSAGE_MAC by changing the last 3 characters of the message passed to session.decrypt() in the code
- Verify in the logs that BAD_MESSAGE_MAC is thrown and session is reset.
Reviewers: kamil, tomek, ashoat
Reviewed By: kamil, ashoat
Subscribers: ashoat, tomek
Differential Revision: https://phab.comm.dev/D13757