Skip to content

Commit 4e0bc46

Browse files
authored
fix: update breadcrumbs to use string instead of string[] for turbopuffer type checking (#5713)
1 parent ec67a67 commit 4e0bc46

File tree

6 files changed

+18
-6
lines changed

6 files changed

+18
-6
lines changed

packages/fern-docs/search-server/utils/src/turbopuffer/TurbopufferRecord.ts

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -14,7 +14,7 @@ export const TurbopufferRecordSchema = z.object({
1414
keywords: z.array(z.string()).optional(),
1515
authed: z.boolean().optional(),
1616
content_type: z.string().optional(),
17-
breadcrumbs: z.union([z.string(), z.array(z.string())]).optional(),
17+
breadcrumbs: z.string().optional(),
1818
chunk_index: z.number().optional(),
1919
parent_id: z.string().optional(),
2020
parent_content_hash: z.string().optional(),

servers/fai-reindexing/src/services/turbopuffer/records/create-endpoint-record-http.ts

Lines changed: 4 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -66,7 +66,10 @@ export function createEndpointBaseRecordHttp({
6666

6767
const { roles, authed: isNodeAuthed } = createViewersForNodes([...parents, node], authed);
6868

69-
const breadcrumbs = FernNavigation.utils.createBreadcrumb([...parents, node]).map((b) => b.title);
69+
const breadcrumbs = FernNavigation.utils
70+
.createBreadcrumb([...parents, node])
71+
.map((b) => b.title)
72+
.join(", ");
7073

7174
return {
7275
id: createHash("sha256").update(node.id).digest("hex"),

servers/fai-reindexing/src/services/turbopuffer/records/create-endpoint-record-web-socket.ts

Lines changed: 4 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -77,7 +77,10 @@ export function createEndpointBaseRecordWebSocket({
7777

7878
const { roles, authed: isNodeAuthed } = createViewersForNodes([...parents, node], authed);
7979

80-
const breadcrumbs = FernNavigation.utils.createBreadcrumb([...parents, node]).map((b) => b.title);
80+
const breadcrumbs = FernNavigation.utils
81+
.createBreadcrumb([...parents, node])
82+
.map((b) => b.title)
83+
.join(", ");
8184

8285
return {
8386
id: createHash("sha256").update(node.webSocketId).digest("hex"),

servers/fai-reindexing/src/services/turbopuffer/records/create-endpoint-record-webhook.ts

Lines changed: 4 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -63,7 +63,10 @@ export function createEndpointBaseRecordWebhook({
6363

6464
const document = `${document_body}\n\n${description}`;
6565

66-
const breadcrumbs = FernNavigation.utils.createBreadcrumb([...parents, node]).map((b) => b.title);
66+
const breadcrumbs = FernNavigation.utils
67+
.createBreadcrumb([...parents, node])
68+
.map((b) => b.title)
69+
.join(", ");
6770

6871
return {
6972
id: createHash("sha256").update(node.webhookId).digest("hex"),

servers/fai-reindexing/src/services/turbopuffer/records/create-markdown-records.ts

Lines changed: 4 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -58,7 +58,10 @@ export async function createMarkdownRecords({
5858

5959
const { roles, authed: isNodeAuthed } = createViewersForNodes([...parents, node], authed);
6060

61-
const breadcrumbs = FernNavigation.utils.createBreadcrumb([...parents, node]).map((b) => b.title);
61+
const breadcrumbs = FernNavigation.utils
62+
.createBreadcrumb([...parents, node])
63+
.map((b) => b.title)
64+
.join(", ");
6265

6366
const markdownChunks = isChangelog ? [markdown] : chunkMarkdown(markdown);
6467

servers/fai/src/fai/models/utils/record.py

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -15,7 +15,7 @@ class TurbopufferRecord(BaseModel):
1515
keywords: list[str] | None = None
1616
authed: bool | None = None
1717
content_type: str | None = None
18-
breadcrumbs: str | list[str] | None = None
18+
breadcrumbs: str | None = None
1919
chunk_index: int | None = None
2020
parent_id: str | None = None
2121
parent_content_hash: str | None = None

0 commit comments

Comments
 (0)