From 10b333051175c43c58783b4d7d32588dd54d35c5 Mon Sep 17 00:00:00 2001 From: Tommie Gannert Date: Tue, 19 Oct 2021 11:48:18 +0200 Subject: [PATCH] Fix a bug in EDU Typing handling in syncapi. When a user's typing status times out, it must advance both the Notifier and the EDUCache. This inconsistency meant that some Sytests that only does a single `/sync` saw a returned event stream it didn't expect (though empty), and failed. In production, this likely just has the effect of adding extra load on `/sync`, as the stream positions will resync the next time a user is added or removed via API. --- syncapi/consumers/eduserver_typing.go | 1 + 1 file changed, 1 insertion(+) diff --git a/syncapi/consumers/eduserver_typing.go b/syncapi/consumers/eduserver_typing.go index c10d1e94e..8d06e3ca8 100644 --- a/syncapi/consumers/eduserver_typing.go +++ b/syncapi/consumers/eduserver_typing.go @@ -74,6 +74,7 @@ func NewOutputTypingEventConsumer( func (s *OutputTypingEventConsumer) Start() error { s.eduCache.SetTimeoutCallback(func(userID, roomID string, latestSyncPosition int64) { pos := types.StreamPosition(latestSyncPosition) + s.stream.Advance(pos) s.notifier.OnNewTyping(roomID, types.StreamingToken{TypingPosition: pos}) }) return s.typingConsumer.Start()