mirror of
https://github.com/matrix-org/dendrite.git
synced 2026-01-16 18:43:10 -06:00
Merge branch 'main' into s7evink/retiredinvites
This commit is contained in:
commit
0146e9a49d
|
|
@ -1004,9 +1004,12 @@ func TestQueueInteractsWithRealDatabasePDUAndEDU(t *testing.T) {
|
|||
err := queues.SendEvent(ev, "localhost", []gomatrixserverlib.ServerName{destination})
|
||||
assert.NoError(t, err)
|
||||
|
||||
// NOTE : The server can be blacklisted before this, so manually inject the event
|
||||
// into the database.
|
||||
edu := mustCreateEDU(t)
|
||||
errEDU := queues.SendEDU(edu, "localhost", []gomatrixserverlib.ServerName{destination})
|
||||
assert.NoError(t, errEDU)
|
||||
ephemeralJSON, _ := json.Marshal(edu)
|
||||
nid, _ := db.StoreJSON(pc.Context(), string(ephemeralJSON))
|
||||
db.AssociateEDUWithDestination(pc.Context(), destination, nid, edu.Type, nil)
|
||||
|
||||
checkBlacklisted := func(log poll.LogT) poll.Result {
|
||||
if fc.txCount.Load() == failuresUntilBlacklist {
|
||||
|
|
|
|||
|
|
@ -472,7 +472,9 @@ func (a *KeyInternalAPI) queryRemoteKeys(
|
|||
close(resultCh)
|
||||
}()
|
||||
|
||||
for result := range resultCh {
|
||||
processResult := func(result *gomatrixserverlib.RespQueryKeys) {
|
||||
respMu.Lock()
|
||||
defer respMu.Unlock()
|
||||
for userID, nest := range result.DeviceKeys {
|
||||
res.DeviceKeys[userID] = make(map[string]json.RawMessage)
|
||||
for deviceID, deviceKey := range nest {
|
||||
|
|
@ -495,6 +497,10 @@ func (a *KeyInternalAPI) queryRemoteKeys(
|
|||
// TODO: do we want to persist these somewhere now
|
||||
// that we have fetched them?
|
||||
}
|
||||
|
||||
for result := range resultCh {
|
||||
processResult(result)
|
||||
}
|
||||
}
|
||||
|
||||
func (a *KeyInternalAPI) queryRemoteKeysOnServer(
|
||||
|
|
|
|||
Loading…
Reference in a new issue