fix(onboarding): route provider-details link by node id, not provider slug (#6145) (#6145)

Route onboarding provider-details link by node id (#6145). Integrated into release/v3.8.44.
This commit is contained in:
Chirag Singhal
2026-07-04 08:56:15 +05:30
committed by GitHub
parent 81f5bce4be
commit d8e4eeef5d
2 changed files with 39 additions and 2 deletions

View File

@@ -260,9 +260,9 @@ function ResultSummary({
)}
<div className="flex flex-wrap gap-2">
{connection?.provider && (
{connection?.id && (
<Link
href={`/dashboard/providers/${connection.provider}`}
href={`/dashboard/providers/${connection.id}`}
className="inline-flex items-center justify-center rounded-lg bg-primary px-4 py-2 text-sm font-medium text-white transition-colors hover:bg-primary/90"
>
{providerText(t, "onboardingOpenProviderDetails", "Open provider details")}

View File

@@ -0,0 +1,37 @@
import test from "node:test";
import assert from "node:assert/strict";
import { readFileSync } from "node:fs";
import { fileURLToPath } from "node:url";
import { dirname, join } from "node:path";
// Regression guard for #6145: the onboarding success-screen "Open provider
// details" link must route by `connection.id` (the node id the
// `/dashboard/providers/[id]` route expects), NOT `connection.provider` (the
// provider slug/type). The old code produced `/dashboard/providers/<provider-slug>`
// which 404s for openai-compatible / anthropic-compatible providers.
const here = dirname(fileURLToPath(import.meta.url));
const repoRoot = join(here, "..", "..");
const wizard = readFileSync(
join(
repoRoot,
"src/app/(dashboard)/dashboard/providers/components/onboarding/ProviderOnboardingWizard.tsx"
),
"utf8"
);
test("#6145: provider-details link routes by connection.id (matches the [id] route)", () => {
assert.match(
wizard,
/href=\{`\/dashboard\/providers\/\$\{connection\.id\}`\}/,
"the details link must build the URL from connection.id"
);
});
test("#6145: provider-details link must NOT use connection.provider (404s for compat providers)", () => {
assert.doesNotMatch(
wizard,
/href=\{`\/dashboard\/providers\/\$\{connection\.provider\}`\}/,
"connection.provider is the slug/type, not the node id — it 404s"
);
});