matrix-org / matrix-org/matrix-rust-sdk
Add a public `receive_keys_query()` method to the OlmMachine
- Dominant language
- Rust
- Stars
- 2.3k
- Forks
- 500
- Avg merge
- 1d 16h
- Merged PRs (30d)
- 106
Description
It has become apparent that we can't only rely on our user tracking to insert all the devices care about into the store. One such scenario is when we try to start a verification with a user that we don't share an E2EE room with.
While it's possible to use the `mark_request_as_sent()` method to feed any `/keys/query` response into the `OlmMachine` this is a bit magical and a hack, i.e. you need to make up a `request_id` to call this method.
We should add a dedicated method that will consume arbitrary `/keys/query` responses, essentially making the `receive_keys_query()` method public.
We should carefully document when it is fine to feed arbitrary `/keys/query` responses into the state machine.
I think this might boil down to "it is always fine to query the keys for untracked users", if that's case we might filter out the tracked users from responses that aren't sent out automatically. This will prevent users from introducing data races between the two sources of `/keys/query` responses.
Contributor guide
Research direction
Start with the OlmMachine implementation and the existing private receive_keys_query() path, then compare it with mark_request_as_sent() and the /keys/query response flow. Define and document when arbitrary responses are safe, including how tracked users and concurrent response sources are handled; done means a public method and documentation covering that behavior.
Written by the indexing model from the issue text.
Assessment
- Tech stack
- rust
- Domain
- api, security
- Issue type
- Feature
- Difficulty
- 4/5
- Estimated time
- 3-5 days
- Activity status
- Stale
- Clarity
- Mostly clear
- Newbie friendliness
- 48/100