Skip to content

feat(site): use websocket connection for devcontainer updates #18808

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

Merged
merged 33 commits into from
Jul 14, 2025
Merged
Show file tree
Hide file tree
Changes from 1 commit
Commits
Show all changes
33 commits
Select commit Hold shift + click to select a range
487ee95
feat(site): use websocket connection for devcontainer updates
DanielleMaywood Jul 3, 2025
cc42018
fix: some issues
DanielleMaywood Jul 7, 2025
fa46517
Merge branch 'main' into danielle/container-push
DanielleMaywood Jul 7, 2025
5aef560
Merge branch 'main' into danielle/container-push
DanielleMaywood Jul 8, 2025
975ef8b
chore: fix disconnect bug and add agentcontainers test
DanielleMaywood Jul 8, 2025
8fdeca3
Merge branch 'main' into danielle/container-push
DanielleMaywood Jul 9, 2025
6da941f
test: add coderd/ test
DanielleMaywood Jul 9, 2025
ff5725e
chore: appease formatter
DanielleMaywood Jul 9, 2025
178507c
chore: feedback
DanielleMaywood Jul 9, 2025
367b87d
chore: fix nil exception
DanielleMaywood Jul 9, 2025
34b17c4
chore: make gen
DanielleMaywood Jul 9, 2025
8f12460
fix: docs
DanielleMaywood Jul 9, 2025
81022fa
Merge branch 'main' into danielle/container-push
DanielleMaywood Jul 9, 2025
1768f7b
fix: only send when there are updates
DanielleMaywood Jul 9, 2025
8240663
chore: lint and format
DanielleMaywood Jul 9, 2025
6d97960
Merge branch 'main' into danielle/container-push
DanielleMaywood Jul 10, 2025
88a611d
chore: test `useAgentContainers`
DanielleMaywood Jul 10, 2025
001ccda
chore: check container ids match in `Equals` function
DanielleMaywood Jul 10, 2025
3e50965
chore: add logger to WatchContainers
DanielleMaywood Jul 10, 2025
6ce5c19
chore: reposition close of update channel
DanielleMaywood Jul 10, 2025
cd0c2d5
chore: rename `knownDevcontainers`
DanielleMaywood Jul 10, 2025
04a92a4
chore: use `WebsocketNetConn`
DanielleMaywood Jul 10, 2025
096a85e
chore: steal CloseRead
DanielleMaywood Jul 10, 2025
971f9d6
chore: check agents match
DanielleMaywood Jul 10, 2025
f24401f
test: parsing error and socket error
DanielleMaywood Jul 10, 2025
64d9252
chore: lint and format
DanielleMaywood Jul 10, 2025
40c3fd9
chore: give comment some love
DanielleMaywood Jul 14, 2025
1cda455
chore: re-use json encoder instead of recreating every time
DanielleMaywood Jul 14, 2025
2ded15f
fix: push initial dev container state in websocket
DanielleMaywood Jul 14, 2025
a87f388
fix: do not invalidateQuery + fix bad types
DanielleMaywood Jul 14, 2025
2de01f5
chore: appease linter
DanielleMaywood Jul 14, 2025
00fdae6
chore: broadcast updates in more places, add staleTime: Infinity
DanielleMaywood Jul 14, 2025
a4a4bb2
chore: appease linter
DanielleMaywood Jul 14, 2025
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
Prev Previous commit
Next Next commit
chore: lint and format
  • Loading branch information
DanielleMaywood committed Jul 10, 2025
commit 64d925246e69b3940706f4108e678371c4b6ac62
1 change: 0 additions & 1 deletion site/src/modules/resources/AgentRow.tsx
Original file line number Diff line number Diff line change
Expand Up @@ -23,7 +23,6 @@ import {
useRef,
useState,
} from "react";
import { useQueryClient } from "react-query";
import AutoSizer from "react-virtualized-auto-sizer";
import type { FixedSizeList as List, ListOnScrollProps } from "react-window";
import { AgentApps, organizeAgentApps } from "./AgentApps/AgentApps";
Expand Down
14 changes: 10 additions & 4 deletions site/src/modules/resources/useAgentContainers.test.tsx
Original file line number Diff line number Diff line change
@@ -1,4 +1,7 @@
import { renderHook, waitFor } from "@testing-library/react";
import * as API from "api/api";
import type { WorkspaceAgentDevcontainer } from "api/typesGenerated";
import * as GlobalSnackbar from "components/GlobalSnackbar/utils";
import { http, HttpResponse } from "msw";
import type { FC, PropsWithChildren } from "react";
import { QueryClient, QueryClientProvider } from "react-query";
Expand All @@ -7,9 +10,8 @@ import {
MockWorkspaceAgentDevcontainer,
} from "testHelpers/entities";
import { server } from "testHelpers/server";
import type { OneWayWebSocket } from "utils/OneWayWebSocket";
import { useAgentContainers } from "./useAgentContainers";
import * as API from "api/api";
import * as GlobalSnackbar from "components/GlobalSnackbar/utils";

const createWrapper = (): FC<PropsWithChildren> => {
const queryClient = new QueryClient({
Expand Down Expand Up @@ -93,7 +95,9 @@ describe("useAgentContainers", () => {
addEventListener: jest.fn(),
close: jest.fn(),
};
watchAgentContainersSpy.mockReturnValue(mockSocket as any);
watchAgentContainersSpy.mockReturnValue(
mockSocket as unknown as OneWayWebSocket<WorkspaceAgentDevcontainer[]>,
);

server.use(
http.get(
Expand Down Expand Up @@ -146,7 +150,9 @@ describe("useAgentContainers", () => {
addEventListener: jest.fn(),
close: jest.fn(),
};
watchAgentContainersSpy.mockReturnValue(mockSocket as any);
watchAgentContainersSpy.mockReturnValue(
mockSocket as unknown as OneWayWebSocket<WorkspaceAgentDevcontainer[]>,
);

server.use(
http.get(
Expand Down
Loading
pFad - Phonifier reborn

Pfad - The Proxy pFad of © 2024 Garber Painting. All rights reserved.

Note: This service is not intended for secure transactions such as banking, social media, email, or purchasing. Use at your own risk. We assume no liability whatsoever for broken pages.


Alternative Proxies:

Alternative Proxy

pFad Proxy

pFad v3 Proxy

pFad v4 Proxy