Skip to content

fix: invalid references to http client & cli#259

Merged
fioan89 merged 3 commits intomainfrom
fix-invalid-references-to-http-client-and-cli
Feb 3, 2026
Merged

fix: invalid references to http client & cli#259
fioan89 merged 3 commits intomainfrom
fix-invalid-references-to-http-client-and-cli

Conversation

@fioan89
Copy link
Collaborator

@fioan89 fioan89 commented Feb 2, 2026

Each environment holds a reference to the http client and the cli
mainly for operations like start, stop, update, etc... performed by
either one or the other.

In the past we recreated the environment instances each time we polled,
effectively updating the references to the cli and http client.
This was really important for the cases where Coder Toolbox was already
running and a URI was executed. In this case we recreate new instances of
the http client and cli that are the used by the poller to create a new
list of environments. However, not too long we discovered that recreating
the environments instances each time has unwanted effects. The obvious fix
was to update the existing env. instances instead of creating new ones.
But the update failed to take into account that the cli and http client
references also need to a refresh after a URI execution.

As a result, environment actions stopped working after new instances were created
by the URI handler. This fix ensures those references are properly refreshed.

- unused methods
Each environment holds a reference to the http client and the cli
mainly for operations like start, stop, update, etc... performed by
either one or the other.

In the past we recreated the environment instances each time we polled,
effectively updating the references to the cli and http client.
This was really important for the cases where Coder Toolbox was already
running and a URI was executed. In this case we recreate new instances of
the http client and cli that are the used by the poller to create a new
list of environments. However, not too long we discovered that recreating
the environments instances each time has unwanted effects. The obvious fix
was to update the existing env. instances instead of creating new ones.
But the update failed to take into account that the cli and http client
references also need to a refresh after a URI execution.

As a result, environment actions stopped working after new instances were created
by the URI handler. This fix ensures those references are properly refreshed.
@fioan89 fioan89 requested review from f0ssel and jcjiang February 2, 2026 20:54
@fioan89 fioan89 merged commit 2e3d419 into main Feb 3, 2026
9 of 16 checks passed
@fioan89 fioan89 deleted the fix-invalid-references-to-http-client-and-cli branch February 3, 2026 19:31
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

2 participants