matrix-org / matrix-org/matrix-js-sdk

Batching of requests from `KeyClaimManager.ensureSessionsForUsers()`

Open
#4,468 0 comments 0 reactions 0 assignees View on GitHub

Nobody has claimed this yet.

A-Element-R T-Enhancement
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

Open the contributing guide

First steps

  1. Read the whole issue, then the project's contributing guide.
  2. Comment on the issue to say you are picking it up — it saves two people doing the same work.
  3. Fork the repository and make your change on a branch.
  4. 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

Get new issues in your inbox

A short digest of beginner-friendly GitHub issues.