Skip to content
Merged
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
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
7 changes: 3 additions & 4 deletions gui/src/pages/integrations/IntegrationsOverview.tsx
Original file line number Diff line number Diff line change
Expand Up @@ -312,11 +312,10 @@ 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 yet. `undefined` covers both pre-response and cold
* failures, while a stale-with-error state still holds 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
15 changes: 15 additions & 0 deletions gui/tests/integrations-surfaces.test.tsx
Original file line number Diff line number Diff line change
Expand Up @@ -646,6 +646,21 @@ test("the overview does not claim nothing is installed while it is still loading
expect(container.textContent ?? "").toContain("No installed clients were detected");
});

test("a failed first read does not claim nothing is installed either", async () => {
/*
* A failed-cold read carries no data, so it is not an answer: the error
* notice must stand alone, without the "nothing detected" panel, and the
* file clients stay as unknown rows rather than a server-side omission.
*/
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(text).toContain("Hermes");
});

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