matrix-org / matrix-org/matrix-js-sdk
Batching of requests from `KeyClaimManager.ensureSessionsForUsers()`
Nobody has claimed this yet.
- Dominant language
- TypeScript
- Stars
- 2.2k
- Forks
- 704
- Avg merge
- 1d 20h
- Merged PRs (30d)
- 40
Description
Currently the rust crypto will do a single key claim request irrespective of the number of users and devices requested:
https://github.com/matrix-org/matrix-js-sdk/blob/a6fb7530cb3320cac9c3e521f76ef0db72cbce82/src/rust-crypto/KeyClaimManager.ts#L79-L83
It would make sense to batch this at an appropriate batch size.
n.b. I don't know whether this should be done by making `getMissingSessions()` return multiple requests, or splitting the requests in KeyClaimManager. Presumably this behaviour might be of concern for the matrix-rust-sdk too.
Contributor guide
First steps
- Read the whole issue, then the project's contributing guide.
- Comment on the issue to say you are picking it up — it saves two people doing the same work.
- Fork the repository and make your change on a branch.
- Open a pull request that references the issue number.
Research direction
Start in src/rust-crypto/KeyClaimManager.ts at the linked ensureSessionsForUsers() code around lines 79-83. Compare batching in getMissingSessions() with splitting requests in KeyClaimManager, and consider the matrix-rust-sdk concern noted in the issue. Done means key claim requests use an appropriate batch size instead of one request for all users and devices.
Written by the indexing model from the issue text.
Assessment
- Tech stack
- typescript
- Domain
- security
- Issue type
- Feature
- Difficulty
- 4/5
- Estimated time
- 3-5 days
- Activity status
- Stale
- Clarity
- Mostly clear
- Newbie friendliness
- 38/100