From 6f4b2600356a61839c38d6f904bf063852db1e0f Mon Sep 17 00:00:00 2001 From: binwiederhier Date: Sat, 4 Mar 2023 09:32:29 -0500 Subject: [PATCH] Tiny changes --- server/server_account_test.go | 2 +- server/server_matrix.go | 2 +- server/server_test.go | 2 +- server/topic.go | 1 - 4 files changed, 3 insertions(+), 4 deletions(-) diff --git a/server/server_account_test.go b/server/server_account_test.go index 7c644689..a2952931 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 704c624b..c25a1b59 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 2ca4f983..032ec6ff 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 f743a9dd..e093a610 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