From 9341c553e7a5140d17c0f0a5da295b368dacf30f Mon Sep 17 00:00:00 2001 From: BrunoQuaresma Date: Mon, 28 Aug 2023 18:02:10 +0000 Subject: [PATCH] fix(coderd): send updated workspace data adter ws connection --- coderd/workspaces.go | 3 +++ 1 file changed, 3 insertions(+) diff --git a/coderd/workspaces.go b/coderd/workspaces.go index 707c85200488b..9384d2b7ecb00 100644 --- a/coderd/workspaces.go +++ b/coderd/workspaces.go @@ -1028,6 +1028,9 @@ func (api *API) watchWorkspace(rw http.ResponseWriter, r *http.Request) { _ = sendEvent(ctx, codersdk.ServerSentEvent{ Type: codersdk.ServerSentEventTypePing, }) + // Send updated workspace info after connection is established. This avoids + // missing updates if the client connects after an update. + sendUpdate(ctx, nil) for { select {