From d138ed73148af4163ab65b33553493f4172f6a3f Mon Sep 17 00:00:00 2001 From: Bruno Quaresma Date: Mon, 28 Aug 2023 15:14:17 -0300 Subject: [PATCH] fix(coderd): send updated workspace data adter ws connection (#9392) --- coderd/workspaces.go | 3 +++ 1 file changed, 3 insertions(+) diff --git a/coderd/workspaces.go b/coderd/workspaces.go index 707c852004..9384d2b7ec 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 {