aboutsummaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorAriadne Conill <ariadne@dereferenced.org>2020-12-01 10:01:34 -0700
committerGitHub <noreply@github.com>2020-12-01 17:01:34 +0000
commitd5b8260196f3e5e9b2d0799454c795c5f5b15fd3 (patch)
tree022f83165eb20c8d27c10f855f6cf65e6a822bcf
parentc667a19775e3e1fc7d57cdadacefe183fbefcbe1 (diff)
syncapi/requestpool: fix initial sync logic error in appendAccountData() (#1594)
* requestpool: fix initial sync logic error in appendAccountData() In initial sync, req.since is no longer nil, but instead, req.since.PDUPosition() and req.since.EDUPosition() returns 0. This ensures forgotten rooms do not come back as zombies. * syncapi/requestpool: reintroduce req.since == nil check
-rw-r--r--syncapi/sync/requestpool.go2
1 files changed, 1 insertions, 1 deletions
diff --git a/syncapi/sync/requestpool.go b/syncapi/sync/requestpool.go
index 61f8c46f..cb84c5bb 100644
--- a/syncapi/sync/requestpool.go
+++ b/syncapi/sync/requestpool.go
@@ -328,7 +328,7 @@ func (rp *RequestPool) appendAccountData(
// data keys were set between two message. This isn't a huge issue since the
// duplicate data doesn't represent a huge quantity of data, but an optimisation
// here would be making sure each data is sent only once to the client.
- if req.since == nil {
+ if req.since == nil || (req.since.PDUPosition() == 0 && req.since.EDUPosition() == 0) {
// If this is the initial sync, we don't need to check if a data has
// already been sent. Instead, we send the whole batch.
dataReq := &userapi.QueryAccountDataRequest{