Skip to content

Commit 77839f9

Browse files
waleedlatif1claude
andcommitted
fix(kb): simplify tag slot reuse, revert Linear GraphQL types to String
Clean up newTagSlotMapping into direct assignment, remove unnecessary comment, and revert ID! back to String! to match Linear SDK types. Co-Authored-By: Claude Opus 4.6 <noreply@anthropic.com>
1 parent e12f15f commit 77839f9

File tree

2 files changed

+6
-7
lines changed

2 files changed

+6
-7
lines changed

apps/sim/app/api/knowledge/[id]/connectors/route.ts

Lines changed: 3 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -162,7 +162,7 @@ export async function POST(request: NextRequest, { params }: { params: Promise<{
162162
}
163163

164164
const tagSlotMapping: Record<string, string> = {}
165-
const newTagSlotMapping: Record<string, string> = {}
165+
let newTagSlots: Record<string, string> = {}
166166

167167
if (connectorConfig.tagDefinitions?.length) {
168168
const disabledIds = new Set((sourceConfig.disabledTagIds as string[] | undefined) ?? [])
@@ -179,7 +179,6 @@ export async function POST(request: NextRequest, { params }: { params: Promise<{
179179
const usedSlots = new Set<string>(existingDefs.map((d) => d.tagSlot))
180180
const existingByName = new Map(existingDefs.map((d) => [d.displayName, d.tagSlot]))
181181

182-
/** Reuse existing tag definitions that match by display name */
183182
const defsNeedingSlots: typeof enabledDefs = []
184183
for (const td of enabledDefs) {
185184
const existingSlot = existingByName.get(td.displayName)
@@ -192,7 +191,7 @@ export async function POST(request: NextRequest, { params }: { params: Promise<{
192191

193192
const { mapping, skipped: skippedTags } = allocateTagSlots(defsNeedingSlots, usedSlots)
194193
Object.assign(tagSlotMapping, mapping)
195-
Object.assign(newTagSlotMapping, mapping)
194+
newTagSlots = mapping
196195

197196
for (const name of skippedTags) {
198197
logger.warn(`[${requestId}] No available slots for "${name}"`)
@@ -226,7 +225,7 @@ export async function POST(request: NextRequest, { params }: { params: Promise<{
226225
throw new Error('Knowledge base not found')
227226
}
228227

229-
for (const [semanticId, slot] of Object.entries(newTagSlotMapping)) {
228+
for (const [semanticId, slot] of Object.entries(newTagSlots)) {
230229
const td = connectorConfig.tagDefinitions!.find((d) => d.id === semanticId)!
231230
await createTagDefinition(
232231
{

apps/sim/connectors/linear/linear.ts

Lines changed: 3 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -119,7 +119,7 @@ const ISSUE_FIELDS = `
119119
`
120120

121121
const ISSUE_BY_ID_QUERY = `
122-
query GetIssue($id: ID!) {
122+
query GetIssue($id: String!) {
123123
issue(id: $id) {
124124
${ISSUE_FIELDS}
125125
}
@@ -147,13 +147,13 @@ function buildIssuesQuery(sourceConfig: Record<string, unknown>): {
147147
const variables: Record<string, unknown> = {}
148148

149149
if (teamId) {
150-
varDefs.push('$teamId: ID!')
150+
varDefs.push('$teamId: String!')
151151
filterClauses.push('team: { id: { eq: $teamId } }')
152152
variables.teamId = teamId
153153
}
154154

155155
if (projectId) {
156-
varDefs.push('$projectId: ID!')
156+
varDefs.push('$projectId: String!')
157157
filterClauses.push('project: { id: { eq: $projectId } }')
158158
variables.projectId = projectId
159159
}

0 commit comments

Comments
 (0)