From b7f09f78b05a3e0dfb3fd008d4b1d2fc0b5a9a74 Mon Sep 17 00:00:00 2001 From: Neil Alexander Date: Fri, 3 Dec 2021 17:26:30 +0000 Subject: [PATCH 1/2] Cherry-pick typing fix from #2061 Co-authored-by: Tommie Gannert --- 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() From 61406a6747f721e6db99fc62eeb6102ff702546f Mon Sep 17 00:00:00 2001 From: Neil Alexander Date: Fri, 3 Dec 2021 17:30:14 +0000 Subject: [PATCH 2/2] Cherry-pick removal of unused HTTP client from #2061 Co-authored-by: Tommie Gannert --- setup/base/base.go | 10 ---------- 1 file changed, 10 deletions(-) diff --git a/setup/base/base.go b/setup/base/base.go index 9ba88bef7..06c971170 100644 --- a/setup/base/base.go +++ b/setup/base/base.go @@ -21,7 +21,6 @@ import ( "io" "net" "net/http" - "net/url" "os" "os/signal" "syscall" @@ -79,7 +78,6 @@ type BaseDendrite struct { SynapseAdminMux *mux.Router UseHTTPAPIs bool apiHttpClient *http.Client - httpClient *http.Client Cfg *config.Dendrite Caches *caching.Caches DNSCache *gomatrixserverlib.DNSCache @@ -183,13 +181,6 @@ func NewBaseDendrite(cfg *config.Dendrite, componentName string, options ...Base }, }, } - client := http.Client{Timeout: HTTPClientTimeout} - if cfg.FederationAPI.Proxy.Enabled { - client.Transport = &http.Transport{Proxy: http.ProxyURL(&url.URL{ - Scheme: cfg.FederationAPI.Proxy.Protocol, - Host: fmt.Sprintf("%s:%d", cfg.FederationAPI.Proxy.Host, cfg.FederationAPI.Proxy.Port), - })} - } // Ideally we would only use SkipClean on routes which we know can allow '/' but due to // https://github.com/gorilla/mux/issues/460 we have to attach this at the top router. @@ -219,7 +210,6 @@ func NewBaseDendrite(cfg *config.Dendrite, componentName string, options ...Base InternalAPIMux: mux.NewRouter().SkipClean(true).PathPrefix(httputil.InternalPathPrefix).Subrouter().UseEncodedPath(), SynapseAdminMux: mux.NewRouter().SkipClean(true).PathPrefix("/_synapse/").Subrouter().UseEncodedPath(), apiHttpClient: &apiClient, - httpClient: &client, } }