Skip to content
Draft
Show file tree
Hide file tree
Changes from all commits
Commits
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
8 changes: 4 additions & 4 deletions gui/src/pages/integrations/IntegrationsOverview.tsx
Original file line number Diff line number Diff line change
Expand Up @@ -260,11 +260,11 @@ export default function IntegrationsOverview({
const installedFileClients = clients.filter(client => client.installed);
/*
* "Settled" is what separates a client the server omitted from one whose
* list has not answered yet. Only a cold state means we have never had an
* answer; a stale-with-error state still holds real rows.
* list has not answered successfully yet. The resource's data is undefined
* both before its first response and after a cold failure; a stale failure
* still holds the last real rows.
*/
const clientsSettled = statesResource.state.kind !== "cold"
&& statesResource.state.kind !== "retrying-cold";
const clientsSettled = statesResource.state.data !== undefined;
const native = nativeResource.state.data ?? null;
// `readOptional` returns null for a failed probe. Only an actual array is a
// settled contract; an empty array is meaningful and removes both switches.
Expand Down
11 changes: 11 additions & 0 deletions gui/tests/integrations-surfaces.test.tsx
Original file line number Diff line number Diff line change
Expand Up @@ -400,6 +400,17 @@ test("the overview does not claim nothing is installed while it is still loading
expect(container.textContent ?? "").toContain("No installed clients were detected");
});

test("the overview does not claim nothing is installed when the client list fails to load", async () => {
stateResponse = () => json({ error: "nope" }, 500);

await mountOverview();

const text = container.textContent ?? "";
expect(text).toContain("Could not load integration state");
expect(text).not.toContain("No installed clients were detected");
expect(container.querySelector('[data-client="hermes"]')).not.toBeNull();
});

test("bulk disable confirms the result with the server before claiming success", async () => {
/*
* The resource layer's `refresh()` is fire-and-forget, so awaiting it proves
Expand Down
Loading