From d61d7472f7567fe55d0376cc5b132f43e8672def Mon Sep 17 00:00:00 2001 From: Terje Sannum Date: Mon, 11 Dec 2023 16:12:59 +0100 Subject: [PATCH] use sync mode to ensure correct sequenct of messages --- internal/home/home.go | 1 + 1 file changed, 1 insertion(+) diff --git a/internal/home/home.go b/internal/home/home.go index 229b6c3..0f592fa 100644 --- a/internal/home/home.go +++ b/internal/home/home.go @@ -138,6 +138,7 @@ func (h *Home) SubscribeMeasurements(ctx context.Context, hc *http.Client, wsUrl subscriber := graphql.NewSubscriptionClient(wsUrl) subscriber.WithProtocol(graphql.GraphQLWS) subscriber.WithConnectionParams(map[string]interface{}{"token": token}) + subscriber.WithSyncMode(true) subscriber.WithLog(log.Println) subscriber.WithRetryTimeout(time.Second * 5) subscriber.WithWebSocketOptions(graphql.WebsocketOptions{HTTPClient: hc})