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

Crypto: Improve logging around OTKs #3388

Open
kegsay opened this issue May 8, 2024 · 1 comment
Open

Crypto: Improve logging around OTKs #3388

kegsay opened this issue May 8, 2024 · 1 comment

Comments

@kegsay
Copy link
Member

kegsay commented May 8, 2024

I've seen some bug reports which report Failed to create a new Olm session from a pre-key message: InboundCreation(MissingOneTimeKey(....)). There are many reasons this can happen, but I need more logging to debug this further. In particular:

  • Log whenever an OTK is deleted from the database. They are deleted when they get used (which we probably log already?) but they also get deleted when we reach the max OTK count (which we probably don't log).
  • Log the number of stored OTKs / the max number of OTKs we will store e.g 504/1000 when we add new OTKs.

This serves two purposes:

  • Logging when an OTK is deleted allows us to confirm if the OTK did exist in the first place because it will be present in the bug report logs.
  • Logging the number of stored OTKs allows us to know if we are hitting the max and if the bug could be caused by this.
@poljar
Copy link
Contributor

poljar commented May 8, 2024

Point one was done some time ago:

debug!(
count = key_count,
discarded_keys = ?result.removed,
created_keys = ?result.created,
"Generated new one-time keys"
);

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Projects
None yet
Development

No branches or pull requests

2 participants