mirror of
https://github.com/hoernschen/dendrite.git
synced 2025-07-30 04:52:46 +00:00
Try harder to query remote keys
This commit is contained in:
parent
d459ef5b16
commit
5a00ff3634
1 changed files with 3 additions and 1 deletions
|
@ -227,8 +227,10 @@ func (a *KeyInternalAPI) QueryKeys(ctx context.Context, req *api.QueryKeysReques
|
|||
res.Failures = make(map[string]interface{})
|
||||
|
||||
// get cross-signing keys from the database
|
||||
crossSigningSatisfiedLocally := true
|
||||
if err := a.crossSigningKeys(ctx, req, res); err != nil {
|
||||
util.GetLogger(ctx).WithError(err).Error("Failed to retrieve cross-signing keys from database")
|
||||
crossSigningSatisfiedLocally = false
|
||||
}
|
||||
|
||||
// make a map from domain to device keys
|
||||
|
@ -287,7 +289,7 @@ func (a *KeyInternalAPI) QueryKeys(ctx context.Context, req *api.QueryKeysReques
|
|||
|
||||
// attempt to satisfy key queries from the local database first as we should get device updates pushed to us
|
||||
domainToDeviceKeys = a.remoteKeysFromDatabase(ctx, res, domainToDeviceKeys)
|
||||
if len(domainToDeviceKeys) == 0 {
|
||||
if len(domainToDeviceKeys) == 0 && crossSigningSatisfiedLocally {
|
||||
return // nothing to query
|
||||
}
|
||||
|
||||
|
|
Loading…
Add table
Add a link
Reference in a new issue