mirror of
https://github.com/1f349/dendrite.git
synced 2024-11-22 03:31:41 +00:00
Only store notifications for users with pushers, de-parallelise TestSessionCleanUp
for now
This commit is contained in:
parent
f05ce478f0
commit
bcc27e9e18
@ -214,7 +214,7 @@ func TestSessionCleanUp(t *testing.T) {
|
|||||||
s := newSessionsDict()
|
s := newSessionsDict()
|
||||||
|
|
||||||
t.Run("session is cleaned up after a while", func(t *testing.T) {
|
t.Run("session is cleaned up after a while", func(t *testing.T) {
|
||||||
t.Parallel()
|
// t.Parallel()
|
||||||
dummySession := "helloWorld"
|
dummySession := "helloWorld"
|
||||||
// manually added, as s.addParams() would start the timer with the default timeout
|
// manually added, as s.addParams() would start the timer with the default timeout
|
||||||
s.params[dummySession] = registerRequest{Username: "Testing"}
|
s.params[dummySession] = registerRequest{Username: "Testing"}
|
||||||
@ -226,7 +226,7 @@ func TestSessionCleanUp(t *testing.T) {
|
|||||||
})
|
})
|
||||||
|
|
||||||
t.Run("session is deleted, once the registration completed", func(t *testing.T) {
|
t.Run("session is deleted, once the registration completed", func(t *testing.T) {
|
||||||
t.Parallel()
|
// t.Parallel()
|
||||||
dummySession := "helloWorld2"
|
dummySession := "helloWorld2"
|
||||||
s.startTimer(time.Minute, dummySession)
|
s.startTimer(time.Minute, dummySession)
|
||||||
s.deleteSession(dummySession)
|
s.deleteSession(dummySession)
|
||||||
@ -236,7 +236,7 @@ func TestSessionCleanUp(t *testing.T) {
|
|||||||
})
|
})
|
||||||
|
|
||||||
t.Run("session timer is restarted after second call", func(t *testing.T) {
|
t.Run("session timer is restarted after second call", func(t *testing.T) {
|
||||||
t.Parallel()
|
// t.Parallel()
|
||||||
dummySession := "helloWorld3"
|
dummySession := "helloWorld3"
|
||||||
// the following will start a timer with the default timeout of 5min
|
// the following will start a timer with the default timeout of 5min
|
||||||
s.addParams(dummySession, registerRequest{Username: "Testing"})
|
s.addParams(dummySession, registerRequest{Username: "Testing"})
|
||||||
@ -260,4 +260,4 @@ func TestSessionCleanUp(t *testing.T) {
|
|||||||
t.Error("expected session to device to be delete")
|
t.Error("expected session to device to be delete")
|
||||||
}
|
}
|
||||||
})
|
})
|
||||||
}
|
}
|
||||||
|
@ -139,6 +139,9 @@ func (s *OutputStreamEventConsumer) processMessage(ctx context.Context, event *g
|
|||||||
// removing it means we can send all notifications to
|
// removing it means we can send all notifications to
|
||||||
// e.g. Element's Push gateway in one go.
|
// e.g. Element's Push gateway in one go.
|
||||||
for _, mem := range members {
|
for _, mem := range members {
|
||||||
|
if p, err := s.db.GetPushers(ctx, mem.Localpart); err != nil || len(p) == 0 {
|
||||||
|
continue
|
||||||
|
}
|
||||||
if err := s.notifyLocal(ctx, event, pos, mem, roomSize, roomName); err != nil {
|
if err := s.notifyLocal(ctx, event, pos, mem, roomSize, roomName); err != nil {
|
||||||
log.WithFields(log.Fields{
|
log.WithFields(log.Fields{
|
||||||
"localpart": mem.Localpart,
|
"localpart": mem.Localpart,
|
||||||
|
Loading…
Reference in New Issue
Block a user