Tiny changes
This commit is contained in:
parent
bb7a751e58
commit
6f4b260035
4 changed files with 3 additions and 4 deletions
|
@ -705,7 +705,7 @@ func TestAccount_Persist_UserStats_After_Tier_Change(t *testing.T) {
|
||||||
t.Parallel()
|
t.Parallel()
|
||||||
conf := newTestConfigWithAuthFile(t)
|
conf := newTestConfigWithAuthFile(t)
|
||||||
conf.AuthDefault = user.PermissionReadWrite
|
conf.AuthDefault = user.PermissionReadWrite
|
||||||
conf.AuthStatsQueueWriterInterval = 100 * time.Millisecond
|
conf.AuthStatsQueueWriterInterval = 300 * time.Millisecond
|
||||||
s := newTestServer(t, conf)
|
s := newTestServer(t, conf)
|
||||||
defer s.closeDatabases()
|
defer s.closeDatabases()
|
||||||
|
|
||||||
|
|
|
@ -76,7 +76,7 @@ const (
|
||||||
// matrixRejectPushKeyForUnifiedPushTopicWithoutRateVisitorAfter is the time after which a Matrix response
|
// matrixRejectPushKeyForUnifiedPushTopicWithoutRateVisitorAfter is the time after which a Matrix response
|
||||||
// will return an HTTP 200 with the push key (i.e. "rejected":["<pushkey>"]}), if no rate visitor has been set on
|
// will return an HTTP 200 with the push key (i.e. "rejected":["<pushkey>"]}), 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
|
// 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
|
matrixRejectPushKeyForUnifiedPushTopicWithoutRateVisitorAfter = 12 * time.Hour
|
||||||
)
|
)
|
||||||
|
|
||||||
|
|
|
@ -1357,7 +1357,7 @@ func TestServer_MatrixGateway_Push_Failure_NoSubscriber_After13Hours(t *testing.
|
||||||
s := newTestServer(t, c)
|
s := newTestServer(t, c)
|
||||||
notification := `{"notification":{"devices":[{"pushkey":"http://127.0.0.1:12345/mytopic?up=1"}]}}`
|
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)
|
response := request(t, s, "POST", "/_matrix/push/v1/notify", notification, nil)
|
||||||
require.Equal(t, 507, response.Code)
|
require.Equal(t, 507, response.Code)
|
||||||
require.Equal(t, 50701, toHTTPError(t, response.Body.String()).Code)
|
require.Equal(t, 50701, toHTTPError(t, response.Body.String()).Code)
|
||||||
|
|
|
@ -10,7 +10,6 @@ import (
|
||||||
|
|
||||||
const (
|
const (
|
||||||
// topicExpungeAfter defines how long a topic is active before it is removed from memory.
|
// topicExpungeAfter defines how long a topic is active before it is removed from memory.
|
||||||
//
|
|
||||||
// This must be larger than matrixRejectPushKeyForUnifiedPushTopicWithoutRateVisitorAfter to give
|
// This must be larger than matrixRejectPushKeyForUnifiedPushTopicWithoutRateVisitorAfter to give
|
||||||
// time for more requests to come in, so that we can send a {"rejected":["<pushkey>"]} response back.
|
// time for more requests to come in, so that we can send a {"rejected":["<pushkey>"]} response back.
|
||||||
topicExpungeAfter = 16 * time.Hour
|
topicExpungeAfter = 16 * time.Hour
|
||||||
|
|
Loading…
Reference in a new issue