Skip to content

bug: ui: workspace view does not automatically update when devcontainer starts #594

New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Closed
johnstcn opened this issue Apr 23, 2025 · 4 comments · Fixed by coder/coder#17619
Closed
Assignees
Labels

Comments

@johnstcn
Copy link
Member

Problem

When starting a workspace with the new Early Access Devcontainers feature, the workspace view does not automatically update when a devcontainer starts or stops.

Steps to reproduce

Create a workspace using this template: https://dev.coder.com/templates/coder/maf-devcontainers

For ease of reproduction you can use https://github.com/coder/envbuilder-starter-devcontainer as it is relatively quick to build.

Observe that when the workspace finishes building and the workspace build logs show a log line similar to the below, no containers show up in the UI:

{"outcome":"success","containerId":"b0147cc98f61c51a30123481815809dd7bd31421aa614b2718dbe4581dc2443d","remoteUser":"coder","remoteWorkspaceFolder":"/workspaces/coder"}

Upon refreshing the page, the container will show up in the UI.

@matifali matifali added the site label Apr 29, 2025
@BrunoQuaresma
Copy link

Is there any field in the workspace response we could use to detect when to refetch the devcontainers?

We use a websocket connection to update the workspace status in the UI, if we have an attribute that could tell us when a devcontainer status changed, it would be enough for the FE to know when to reload the devontainers data.

@bartekgatzcoder
Copy link

Hey @BrunoQuaresma

During the weekly update today we have decided that this bug should be fixed before we expose Early Access to the world. Given the release is in a week, and a code freeze is today, this does not leave us that much time to implement the "proper" mechanism.

We do not have any trigger today, so the team suggested the frontend periodically polls the backend for updates on the devcontainers. The backend seems to be caching this information with 10s resolution, so if we use the 10s polling interval it should be enough. Also, we should only do this polling in case we deal with a devcontainer-enabled template.

Can you pull such a temporary solution for 2.22 until we solve this properly on the backend?

@matifali FYI

@BrunoQuaresma
Copy link

Sure thing! How do I know when a template is "devcontainer-enabled"?

@mafredri
Copy link
Member

@BrunoQuaresma I just merged handling for this, perhaps the return response could be changed to inform the code of it being enabled or not?

https://github.com/coder/coder/blob/1fc74f629e45effe7a2419a2a3d0440b4fa8eacc/site/src/api/api.ts#L2457-L2461

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
Projects
None yet
Development

Successfully merging a pull request may close this issue.

5 participants