diff --git a/server/server_account_test.go b/server/server_account_test.go index 7c64468..a295293 100644 --- a/server/server_account_test.go +++ b/server/server_account_test.go @@ -705,7 +705,7 @@ func TestAccount_Persist_UserStats_After_Tier_Change(t *testing.T) { t.Parallel() conf := newTestConfigWithAuthFile(t) conf.AuthDefault = user.PermissionReadWrite - conf.AuthStatsQueueWriterInterval = 100 * time.Millisecond + conf.AuthStatsQueueWriterInterval = 300 * time.Millisecond s := newTestServer(t, conf) defer s.closeDatabases() diff --git a/server/server_matrix.go b/server/server_matrix.go index 704c624..c25a1b5 100644 --- a/server/server_matrix.go +++ b/server/server_matrix.go @@ -76,7 +76,7 @@ const ( // matrixRejectPushKeyForUnifiedPushTopicWithoutRateVisitorAfter is the time after which a Matrix response // will return an HTTP 200 with the push key (i.e. "rejected":[""]}), if no rate visitor has been set on // the topic. Rejecting the push key will instruct the Matrix server to invalidate the pushkey and stop sending - // messages to it. See https://spec.matrix.org/v1.6/push-gateway-api/ + // messages to it. This must be longer than topicExpungeAfter. See https://spec.matrix.org/v1.6/push-gateway-api/ matrixRejectPushKeyForUnifiedPushTopicWithoutRateVisitorAfter = 12 * time.Hour ) diff --git a/server/server_test.go b/server/server_test.go index 2ca4f98..032ec6f 100644 --- a/server/server_test.go +++ b/server/server_test.go @@ -1357,7 +1357,7 @@ func TestServer_MatrixGateway_Push_Failure_NoSubscriber_After13Hours(t *testing. s := newTestServer(t, c) notification := `{"notification":{"devices":[{"pushkey":"http://127.0.0.1:12345/mytopic?up=1"}]}}` - // No success if no rate visitor set (this also creates the topic in memory + // No success if no rate visitor set (this also creates the topic in memory) response := request(t, s, "POST", "/_matrix/push/v1/notify", notification, nil) require.Equal(t, 507, response.Code) require.Equal(t, 50701, toHTTPError(t, response.Body.String()).Code) diff --git a/server/topic.go b/server/topic.go index f743a9d..e093a61 100644 --- a/server/topic.go +++ b/server/topic.go @@ -10,7 +10,6 @@ import ( const ( // topicExpungeAfter defines how long a topic is active before it is removed from memory. - // // This must be larger than matrixRejectPushKeyForUnifiedPushTopicWithoutRateVisitorAfter to give // time for more requests to come in, so that we can send a {"rejected":[""]} response back. topicExpungeAfter = 16 * time.Hour