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})
|
err := queues.SendEvent(ev, "localhost", []gomatrixserverlib.ServerName{destination})
|
||||||
assert.NoError(t, err)
|
assert.NoError(t, err)
|
||||||
|
|
||||||
|
// NOTE : The server can be blacklisted before this, so manually inject the event
|
||||||
|
// into the database.
|
||||||
edu := mustCreateEDU(t)
|
edu := mustCreateEDU(t)
|
||||||
errEDU := queues.SendEDU(edu, "localhost", []gomatrixserverlib.ServerName{destination})
|
ephemeralJSON, _ := json.Marshal(edu)
|
||||||
assert.NoError(t, errEDU)
|
nid, _ := db.StoreJSON(pc.Context(), string(ephemeralJSON))
|
||||||
|
db.AssociateEDUWithDestination(pc.Context(), destination, nid, edu.Type, nil)
|
||||||
|
|
||||||
checkBlacklisted := func(log poll.LogT) poll.Result {
|
checkBlacklisted := func(log poll.LogT) poll.Result {
|
||||||
if fc.txCount.Load() == failuresUntilBlacklist {
|
if fc.txCount.Load() == failuresUntilBlacklist {
|
||||||
|
|
|
||||||
|
|
@ -472,7 +472,9 @@ func (a *KeyInternalAPI) queryRemoteKeys(
|
||||||
close(resultCh)
|
close(resultCh)
|
||||||
}()
|
}()
|
||||||
|
|
||||||
for result := range resultCh {
|
processResult := func(result *gomatrixserverlib.RespQueryKeys) {
|
||||||
|
respMu.Lock()
|
||||||
|
defer respMu.Unlock()
|
||||||
for userID, nest := range result.DeviceKeys {
|
for userID, nest := range result.DeviceKeys {
|
||||||
res.DeviceKeys[userID] = make(map[string]json.RawMessage)
|
res.DeviceKeys[userID] = make(map[string]json.RawMessage)
|
||||||
for deviceID, deviceKey := range nest {
|
for deviceID, deviceKey := range nest {
|
||||||
|
|
@ -495,6 +497,10 @@ func (a *KeyInternalAPI) queryRemoteKeys(
|
||||||
// TODO: do we want to persist these somewhere now
|
// TODO: do we want to persist these somewhere now
|
||||||
// that we have fetched them?
|
// that we have fetched them?
|
||||||
}
|
}
|
||||||
|
|
||||||
|
for result := range resultCh {
|
||||||
|
processResult(result)
|
||||||
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
func (a *KeyInternalAPI) queryRemoteKeysOnServer(
|
func (a *KeyInternalAPI) queryRemoteKeysOnServer(
|
||||||
|
|
|
||||||
Loading…
Reference in a new issue