Skip to content

Commit 5f4fe13

Browse files
committed
fix(knowledge): only send a between tag filter once both bounds are set
Cursor Bugbot: the strict valueTo validation made a partially-entered between filter (lower bound only) 400 and break the whole document list mid-entry. activeTagFilters now withholds a between row until both bounds are filled — consistent with already requiring the lower bound before sending any filter — so the list keeps loading while the range is being entered.
1 parent f44afb5 commit 5f4fe13

1 file changed

Lines changed: 9 additions & 2 deletions

File tree

  • apps/sim/app/workspace/[workspaceId]/knowledge/[id]

apps/sim/app/workspace/[workspaceId]/knowledge/[id]/base.tsx

Lines changed: 9 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -264,13 +264,20 @@ export function KnowledgeBase({
264264
const activeTagFilters: DocumentTagFilter[] = useMemo(
265265
() =>
266266
tagFilterEntries
267-
.filter((f) => f.tagSlot && f.value.trim())
267+
.filter((f) => {
268+
if (!f.tagSlot || !f.value.trim()) return false
269+
// A `between` filter only applies once both bounds are set. Sending it
270+
// with just the lower bound would be rejected at the API boundary and
271+
// break the whole list while the user is still entering the range.
272+
if (f.operator === 'between' && !f.valueTo.trim()) return false
273+
return true
274+
})
268275
.map((f) => ({
269276
tagSlot: f.tagSlot,
270277
fieldType: f.fieldType,
271278
operator: f.operator,
272279
value: f.value,
273-
...(f.operator === 'between' && f.valueTo ? { valueTo: f.valueTo } : {}),
280+
...(f.operator === 'between' ? { valueTo: f.valueTo } : {}),
274281
})),
275282
[tagFilterEntries]
276283
)

0 commit comments

Comments
 (0)