Repository navigation
Closed
Labels
vouch:trustedAuthor is trusted by repo permissions or the VOUCHED list.
Description
Before submitting
- I searched existing issues and did not find a duplicate.
- I included enough detail to reproduce or investigate the problem.
Area
apps/web
Steps to reproduce
- Open Settings → Diagnostics for a connected environment you can edit.
- Enter a traces endpoint that accepts a connection but responds slowly.
- Click Test beside Traces endpoint.
- Replace the URL with a different valid endpoint while the first test is still checking.
Expected behavior
You can test the corrected URL immediately.
Actual behavior
The corrected URL says Not checked, but Test stays disabled until the previous check finishes.
Impact
Minor bug or occasional failure. This delays users who correct a telemetry URL while its previous check is still running.
Version or commit
main at a6d2bed55b. The cause is at apps/web/src/components/settings/TelemetryExportSettings.tsx:263.
Environment
Linux x64 boat.dev default machine, a fresh checkout.
Logs or stack traces
The corrected traces URL can be tested immediatelyAutomated repro
Fails in 2 of 2 runs on main: apply the patch with git apply, then run the command.
diff --git a/scripts/scenarios/corrected-telemetry-url-can-be-tested.e2e.ts b/scripts/scenarios/corrected-telemetry-url-can-be-tested.e2e.ts
new file mode 100644
index 0000000000..020aebc9e3
--- /dev/null
+++ b/scripts/scenarios/corrected-telemetry-url-can-be-tested.e2e.ts
@@ -0,0 +1,63 @@
+import { once } from "node:events";
+// @effect-diagnostics-next-line nodeBuiltinImport:off -- The test runs a loopback OTLP receiver.
+import { createServer } from "node:http";
+import { expect } from "e2e";
+import * as Effect from "effect/Effect";
+import * as Schema from "effect/Schema";
+import { FetchHttpClient, HttpClient, HttpClientResponse } from "effect/http";
+
+import { runPromise, test, WEB } from "./t3.ts";
+
+test(
+ "The corrected traces endpoint can be tested while the previous URL is still checking",
+ WEB,
+ async ({ t3, app, screen, browser }) => {
+ const firstProbe = Promise.withResolvers<void>();
+ const collector = createServer((request, response) => {
+ request.resume();
+ if (request.url === "/slow/v1/traces") {
+ firstProbe.resolve();
+ return;
+ }
+ response.writeHead(200).end();
+ });
+ collector.listen(0, "127.0.0.1");
+ try {
+ await once(collector, "listening");
+ const address = collector.address();
+ if (address === null || typeof address === "string") throw new Error("No collector port");
+ const origin = `http://127.0.0.1:${address.port}`;
+
+ await t3.project("demo");
+ const { environmentId } = await runPromise(
+ HttpClient.get(`${app.baseUrl}/.well-known/t3/environment`).pipe(
+ Effect.flatMap(HttpClientResponse.filterStatusOk),
+ Effect.flatMap(
+ HttpClientResponse.schemaBodyJson(Schema.Struct({ environmentId: Schema.String })),
+ ),
+ Effect.provide(FetchHttpClient.layer),
+ ),
+ );
+ await t3.open(
+ `/settings/diagnostics?machine=${encodeURIComponent(environmentId)}#telemetry-export`,
+ );
+
+ const traces = browser.locator("#otlpTracesUrl");
+ const exportSection = browser.locator("#telemetry-export");
+ const testTraces = exportSection.getByRole("button", "Test").first();
+ await traces.fill(`${origin}/slow/v1/traces`);
+ await testTraces.tap();
+ await firstProbe.promise;
+ await traces.fill(`${origin}/v1/traces`);
+ await exportSection.getByText("Not checked", { exact: true }).waitFor();
+
+ // Sample the screen before the old request reaches its server timeout.
+ const canTestCorrectedUrl = await testTraces.isEnabled();
+ await app.screenshot("corrected-traces-url");
+ expect(canTestCorrectedUrl, "The corrected traces URL can be tested immediately").toBe(true);
+ } finally {
+ collector.close();
+ collector.closeAllConnections();
+ }
+ },
+);pnpm scenarios:prove scripts/scenarios/corrected-telemetry-url-can-be-tested.e2e.ts --base mainWorkaround
No response
Metadata
Metadata
Assignees
Labels
vouch:trustedAuthor is trusted by repo permissions or the VOUCHED list.


Activity