Skip to content

Commit 87ec80b

Browse files
committed
fix more stuff
1 parent c159690 commit 87ec80b

1 file changed

Lines changed: 4 additions & 6 deletions

File tree

apps/sim/lib/knowledge/tags/service.ts

Lines changed: 4 additions & 6 deletions
Original file line numberDiff line numberDiff line change
@@ -81,11 +81,10 @@ async function lockKnowledgeBaseForTagMutation(
8181
.for('update')
8282
}
8383

84-
/** Prevents a tag clear from demoting nonempty or unverifiable provenance to legacy state. */
85-
async function assertTagSlotsCanBeClearedInTx(
84+
/** Prevents tag cleanup from demoting nonempty or unverifiable provenance to legacy state. */
85+
async function assertKnowledgeBaseTagsCanBeClearedInTx(
8686
tx: DbTransaction,
87-
knowledgeBaseId: string,
88-
tagSlots: readonly ValidTagSlot[]
87+
knowledgeBaseId: string
8988
): Promise<void> {
9089
const [conflict] = await tx
9190
.select({ id: document.id })
@@ -95,7 +94,6 @@ async function assertTagSlotsCanBeClearedInTx(
9594
and(
9695
eq(document.knowledgeBaseId, knowledgeBaseId),
9796
eq(document.secretProvenanceVersion, 1),
98-
or(...tagSlots.map((tagSlot) => isNotNull(document[tagSlot]))),
9997
or(
10098
isNull(documentSecretProvenance.documentId),
10199
sql`${documentSecretProvenance.status} IS DISTINCT FROM 'exact'`,
@@ -119,7 +117,7 @@ async function clearTagSlotsInTx(
119117
const clearedTagValues: ClearedTagValues = {}
120118
for (const tagSlot of tagSlots) clearedTagValues[tagSlot] = null
121119

122-
await assertTagSlotsCanBeClearedInTx(tx, knowledgeBaseId, tagSlots)
120+
await assertKnowledgeBaseTagsCanBeClearedInTx(tx, knowledgeBaseId)
123121

124122
await tx
125123
.update(embedding)

0 commit comments

Comments
 (0)