Add this suggestion to a batch that can be applied as a single commit.
This suggestion is invalid because no changes were made to the code.
Suggestions cannot be applied while the pull request is closed.
Suggestions cannot be applied while viewing a subset of changes.
Only one suggestion per line can be applied in a batch.
Add this suggestion to a batch that can be applied as a single commit.
Applying suggestions on deleted lines is not supported.
You must change the existing code in this line in order to create a valid suggestion.
Outdated suggestions cannot be applied.
This suggestion has been applied or marked resolved.
Suggestions cannot be applied from pending reviews.
Suggestions cannot be applied on multi-line comments.
Suggestions cannot be applied while the pull request is queued to merge.
Suggestion cannot be applied right now. Please check back later.
Fixes #1668 and partially resolves #1670
Add
MXKeysQueryScheduler
used with crypto V2, which serves similar purpose asMXDeviceList
serves in legacy crypto, albeit only focusing on optimizingkeys/query
requests.Specifically it will:
These optimizations should ensure that the application does not make unnecessary amout of queries, as we currently call the
downloadKeys
from far too many places. Note that I have previously tried to solve the current/next task in more generic way, but was missing the additional need to aggregate further users. So for now I am adding a case specificMXKeysQueryScheduler
which may later evolve to more genericMXSerialTaskScheduler
In general the application should never query keys directly, except for very few cases (starting new room, refreshing cross signing), but this is not unfortunatelly the case at the moment. To start moving in the right direction I split out
downloadKeysIfNecessary
and a deprecatedreloadKeys
instead of passingforceDownload
parameter. This should make it clearer which API to use.