fix(knowledge): validate tag slots and share the tag-name length limit - #6438
fix(knowledge): validate tag slots and share the tag-name length limit#6438waleedlatif1 wants to merge 1 commit into
Conversation
The create-tag route validates fieldType at runtime because the contract keeps it a plain string. Its sibling bulk route already explains why; without the same note here the check reads as redundant with the contract and invites removal.
|
The latest updates on your projects. Learn more about Vercel for GitHub. |
PR SummaryLow Risk Overview The note clarifies why that guard stays at the route layer: tightening the API contract to the field-type enum would cascade into UI form state types, so validation uses a plain Reviewed by Cursor Bugbot for commit 3026e3a. Configure here. |
Greptile SummaryThe PR adds explanatory documentation for the existing runtime field-type validation in the tag-definition creation route.
Confidence Score: 5/5The PR appears safe to merge. No blocking failure remains.
|
| Filename | Overview |
|---|---|
| apps/sim/app/api/knowledge/[id]/tag-definitions/route.ts | Adds a statement-level documentation comment explaining the existing validation and cast without changing runtime behavior. |
Reviews (2): Last reviewed commit: "chore(knowledge): document the tag-defin..." | Re-trigger Greptile
|
@cursor review |
There was a problem hiding this comment.
✅ Bugbot reviewed your changes and found no new issues!
Comment @cursor review or bugbot run to trigger another review on this PR
Reviewed by Cursor Bugbot for commit 3026e3a. Configure here.
Summary
textwith a types-only Drizzleenum, and the service casts before inserting), so an unknown slot inserted a row nothing can readisValidSlotForFieldType, which also closes a slot/field-type mismatchFIELD_TYPE_LABELSin favour of the shared one two other components already importNotes
100on the bulk document route; this shares that number rather than inventing one. The internal create route previously had no cap, so a >100-char name posted there now 400sisValidSlotForFieldType/getFieldTypeForSlotfromlib/knowledge/constantsType of Change
Testing
Added route tests for unknown slot, slot/field-type mismatch, unsupported field type, and the display-name cap; verified each fails without its guard.
app/api/knowledge+ tools + copilot knowledge suites pass,type-check,lint:check, andcheck:api-validation:strictclean.Checklist