fix(coderd): send updated workspace data adter ws connection (#9392)

This commit is contained in:
Bruno Quaresma
2023-08-28 15:14:17 -03:00
committed by GitHub
parent a2be2f9838
commit d138ed7314

View File

@ -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 {