Skip to content

Commit 87dcc28

Browse files
committed
fix(search): keep the kind on reconnect statuses for unconnected native queries
1 parent 0e6753e commit 87dcc28

2 files changed

Lines changed: 16 additions & 0 deletions

File tree

‎apps/sim/lib/sim-search/live/application.test.ts‎

Lines changed: 15 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -565,6 +565,21 @@ describe('authorized live retrieval', () => {
565565
}),
566566
])
567567
})
568+
it('reports each targeted kind of an unconnected account for reconnection', async () => {
569+
const nativeQueries = (['issues', 'commits'] as const).map((kind) => ({
570+
provider: 'github' as const,
571+
query: 'repo:org/repo launch',
572+
kind,
573+
}))
574+
const result = await searchLiveKnowledge.execute({
575+
principal,
576+
input: { ...input, query: '', nativeQueries },
577+
})
578+
expect(result.live?.accounts).toEqual([
579+
expect.objectContaining({ provider: 'github', kind: 'issues', status: 'reconnect' }),
580+
expect.objectContaining({ provider: 'github', kind: 'commits', status: 'reconnect' }),
581+
])
582+
})
568583
it('rejects invalid dates before resolving provider credentials', async () => {
569584
await expect(
570585
searchLiveKnowledge.execute({

‎apps/sim/lib/sim-search/live/application.ts‎

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -547,6 +547,7 @@ export const searchLiveKnowledge = defineAuthorizedKnowledgeUseCase({
547547
accounts.push({
548548
accountId: query.accountId ?? '',
549549
provider: query.provider,
550+
...(query.kind ? { kind: query.kind } : {}),
550551
displayName: query.provider,
551552
status: 'reconnect',
552553
message: 'No connection with this provider is configured and approved in this scope.',

0 commit comments

Comments
 (0)