mirror of
https://github.com/hoernschen/dendrite.git
synced 2025-07-31 13:22:46 +00:00
Update ACLs when received as outliers (#3008)
This should fix #3004 by making sure we also update our in-memory ACLs after joining a new room. Also makes use of more caching in `GetStateEvent` Bonus: Adds some tests, as I was about to use `GetBulkStateContent`, but turns out that `GetStateEvent` is basically doing the same, just that it only gets the `eventTypeNID`/`eventStateKeyNID` once and not for every call.
This commit is contained in:
parent
c4528b2de8
commit
b8f91485b4
11 changed files with 155 additions and 63 deletions
|
@ -65,7 +65,7 @@ func TestFederationClientQueryKeys(t *testing.T) {
|
|||
queues := queue.NewOutgoingQueues(
|
||||
testDB, process.NewProcessContext(),
|
||||
false,
|
||||
cfg.Matrix.ServerName, fedClient, nil, &stats,
|
||||
cfg.Matrix.ServerName, fedClient, &stats,
|
||||
nil,
|
||||
)
|
||||
fedapi := FederationInternalAPI{
|
||||
|
@ -96,7 +96,7 @@ func TestFederationClientQueryKeysBlacklisted(t *testing.T) {
|
|||
queues := queue.NewOutgoingQueues(
|
||||
testDB, process.NewProcessContext(),
|
||||
false,
|
||||
cfg.Matrix.ServerName, fedClient, nil, &stats,
|
||||
cfg.Matrix.ServerName, fedClient, &stats,
|
||||
nil,
|
||||
)
|
||||
fedapi := FederationInternalAPI{
|
||||
|
@ -126,7 +126,7 @@ func TestFederationClientQueryKeysFailure(t *testing.T) {
|
|||
queues := queue.NewOutgoingQueues(
|
||||
testDB, process.NewProcessContext(),
|
||||
false,
|
||||
cfg.Matrix.ServerName, fedClient, nil, &stats,
|
||||
cfg.Matrix.ServerName, fedClient, &stats,
|
||||
nil,
|
||||
)
|
||||
fedapi := FederationInternalAPI{
|
||||
|
@ -156,7 +156,7 @@ func TestFederationClientClaimKeys(t *testing.T) {
|
|||
queues := queue.NewOutgoingQueues(
|
||||
testDB, process.NewProcessContext(),
|
||||
false,
|
||||
cfg.Matrix.ServerName, fedClient, nil, &stats,
|
||||
cfg.Matrix.ServerName, fedClient, &stats,
|
||||
nil,
|
||||
)
|
||||
fedapi := FederationInternalAPI{
|
||||
|
@ -187,7 +187,7 @@ func TestFederationClientClaimKeysBlacklisted(t *testing.T) {
|
|||
queues := queue.NewOutgoingQueues(
|
||||
testDB, process.NewProcessContext(),
|
||||
false,
|
||||
cfg.Matrix.ServerName, fedClient, nil, &stats,
|
||||
cfg.Matrix.ServerName, fedClient, &stats,
|
||||
nil,
|
||||
)
|
||||
fedapi := FederationInternalAPI{
|
||||
|
|
|
@ -70,7 +70,7 @@ func TestPerformWakeupServers(t *testing.T) {
|
|||
queues := queue.NewOutgoingQueues(
|
||||
testDB, process.NewProcessContext(),
|
||||
false,
|
||||
cfg.Matrix.ServerName, fedClient, nil, &stats,
|
||||
cfg.Matrix.ServerName, fedClient, &stats,
|
||||
nil,
|
||||
)
|
||||
fedAPI := NewFederationInternalAPI(
|
||||
|
@ -116,7 +116,7 @@ func TestQueryRelayServers(t *testing.T) {
|
|||
queues := queue.NewOutgoingQueues(
|
||||
testDB, process.NewProcessContext(),
|
||||
false,
|
||||
cfg.Matrix.ServerName, fedClient, nil, &stats,
|
||||
cfg.Matrix.ServerName, fedClient, &stats,
|
||||
nil,
|
||||
)
|
||||
fedAPI := NewFederationInternalAPI(
|
||||
|
@ -157,7 +157,7 @@ func TestRemoveRelayServers(t *testing.T) {
|
|||
queues := queue.NewOutgoingQueues(
|
||||
testDB, process.NewProcessContext(),
|
||||
false,
|
||||
cfg.Matrix.ServerName, fedClient, nil, &stats,
|
||||
cfg.Matrix.ServerName, fedClient, &stats,
|
||||
nil,
|
||||
)
|
||||
fedAPI := NewFederationInternalAPI(
|
||||
|
@ -197,7 +197,7 @@ func TestPerformDirectoryLookup(t *testing.T) {
|
|||
queues := queue.NewOutgoingQueues(
|
||||
testDB, process.NewProcessContext(),
|
||||
false,
|
||||
cfg.Matrix.ServerName, fedClient, nil, &stats,
|
||||
cfg.Matrix.ServerName, fedClient, &stats,
|
||||
nil,
|
||||
)
|
||||
fedAPI := NewFederationInternalAPI(
|
||||
|
@ -236,7 +236,7 @@ func TestPerformDirectoryLookupRelaying(t *testing.T) {
|
|||
queues := queue.NewOutgoingQueues(
|
||||
testDB, process.NewProcessContext(),
|
||||
false,
|
||||
cfg.Matrix.ServerName, fedClient, nil, &stats,
|
||||
cfg.Matrix.ServerName, fedClient, &stats,
|
||||
nil,
|
||||
)
|
||||
fedAPI := NewFederationInternalAPI(
|
||||
|
|
Loading…
Add table
Add a link
Reference in a new issue