Skip to content

Commit 0679f72

Browse files
committed
fix(docs): validate integration parents and report partial search failures
1 parent 0ec1265 commit 0679f72

2 files changed

Lines changed: 12 additions & 4 deletions

File tree

‎apps/docs/lib/content/navigation.ts‎

Lines changed: 3 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -136,10 +136,11 @@ export function buildNavigation(
136136
parent.kind = 'group'
137137
parent.children = [...(parent.children ?? []), node]
138138
grouped.add(page.url)
139-
} else if (!parentSlug) {
139+
} else if (parentSlug === undefined) {
140140
shared.push(node)
141141
grouped.add(page.url)
142-
}
142+
} else
143+
throw new Error(`Unknown integration parent ${parentSlug} for credential guide ${slug}`)
143144
}
144145
for (const guide of integrationNavigation.relatedPages) {
145146
const parent = children.find((child) => child.url === `/integrations/${guide.integration}`)

‎apps/docs/lib/search/service.ts‎

Lines changed: 9 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -117,8 +117,15 @@ async function hybridSearch(query: string, limit: number, signal?: AbortSignal)
117117
try {
118118
const lists = await Promise.allSettled([keyword, vector ?? Promise.resolve([])])
119119
const scores = new Map<string, { score: number; result: SearchResult }>()
120-
for (const list of lists) {
121-
if (list.status !== 'fulfilled') continue
120+
for (const [source, list] of lists.entries()) {
121+
if (list.status === 'rejected') {
122+
if (!signal?.aborted)
123+
logger.warn('Hybrid search query unavailable; serving remaining results', {
124+
source: source === 0 ? 'keyword' : 'vector',
125+
error: list.reason,
126+
})
127+
continue
128+
}
122129
list.value.forEach((row, index) => {
123130
let citation: URL
124131
try {

0 commit comments

Comments
 (0)