Title: fix(knowledge): validate tag slots and share the tag-name length limit by waleedlatif1 · Pull Request #6438 · simstudioai/sim · GitHub
Open Graph Title: fix(knowledge): validate tag slots and share the tag-name length limit by waleedlatif1 · Pull Request #6438 · simstudioai/sim
X Title: fix(knowledge): validate tag slots and share the tag-name length limit by waleedlatif1 · Pull Request #6438 · simstudioai/sim
Description: Summary Validate the tag slot on write: it reached the DB unchecked (the contract types it as a plain string, the column is text with a types-only Drizzle enum, and the service casts before inserting), so an unknown slot inserted a row nothing can read Create route checks the slot against its declared field type using the existing isValidSlotForFieldType, which also closes a slot/field-type mismatch Bulk document route checks slot validity only — that route also renames existing definitions, which resend whatever pair is already stored, so a legacy mismatched row stays fixable Promote the tag display-name cap to a shared constant and apply it on every write path: both contracts, both modals, and the copilot create/update tools (model-generated names bypassed the contract entirely) Drop two local copies of FIELD_TYPE_LABELS in favour of the shared one two other components already import Notes The display-name cap was already 100 on 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 400s No new helper: the slot checks reuse isValidSlotForFieldType / getFieldTypeForSlot from lib/knowledge/constants Type of Change Bug fix 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, and check:api-validation:strict clean. Checklist Code follows project style guidelines Self-reviewed my changes Tests added/updated and passing No new warnings introduced I confirm that I have read and agree to the terms outlined in the Contributor License Agreement (CLA)
Open Graph Description: Summary Validate the tag slot on write: it reached the DB unchecked (the contract types it as a plain string, the column is text with a types-only Drizzle enum, and the service casts before insert...
X Description: Summary Validate the tag slot on write: it reached the DB unchecked (the contract types it as a plain string, the column is text with a types-only Drizzle enum, and the service casts before insert...
Opengraph URL: https://github.com/simstudioai/sim/pull/6438
X: @github
Domain: github.com
| react-profiling | 0 |
| react-import-map | react,react-dom,react-dom/client,react-dom/profiling,react-is,react-reconciler,react/compiler-runtime,react/jsx-dev-runtime,react/jsx-runtime,scheduler@d5750093facf |
| route-pattern | /:user_id/:repository/pull/:id/files(.:format) |
| route-controller | pull_requests |
| route-action | files |
| fetch-nonce | v2:f54692f5-5b32-dcc3-8d2f-b3cdfbf6f1c0 |
| current-catalog-service-hash | ae870bc5e265a340912cde392f23dad3671a0a881730ffdadd82f2f57d81641b |
| request-id | 83A4:2F2AB3:AF49A4:F18B73:6AFB5189 |
| html-safe-nonce | c13170686421cb79a12264f677aac863200b45880a066e34e61c81478e2ac97f |
| visitor-payload | eyJyZWZlcnJlciI6IiIsInJlcXVlc3RfaWQiOiI4M0E0OjJGMkFCMzpBRjQ5QTQ6RjE4QjczOjZBRkI1MTg5IiwidmlzaXRvcl9pZCI6IjYxMDM0Mjg4NDkwNDEzNjMzMzciLCJyZWdpb25fZWRnZSI6ImlhZCIsInJlZ2lvbl9yZW5kZXIiOiJpYWQifQ== |
| visitor-hmac | 0f307b9b28a32b69a700411aabc4368bb57087f53f8aad1b26fc6024d2be6828 |
| hovercard-subject-tag | pull_request:4235953729 |
| github-keyboard-shortcuts | repository,pull-request-list,pull-request-conversation,pull-request-files-changed,copilot |
| google-site-verification | Apib7-x98H0j5cPqHWwSMm6dNU4GmODRoqxLiDzdx9I |
| octolytics-url | https://collector.github.com/github/collect |
| analytics-location | / |
| fb:app_id | 1401488693436528 |
| apple-itunes-app | app-id=1477376905, app-argument=https://github.com/simstudioai/sim/pull/6438/files |
| twitter:image | https://avatars.githubusercontent.com/u/40672544?s=400&v=4 |
| twitter:card | summary_large_image |
| og:image | https://avatars.githubusercontent.com/u/40672544?s=400&v=4 |
| og:image:alt | Summary Validate the tag slot on write: it reached the DB unchecked (the contract types it as a plain string, the column is text with a types-only Drizzle enum, and the service casts before insert... |
| og:site_name | GitHub |
| og:type | object |
| hostname | github.com |
| expected-hostname | github.com |
| None | 7122bb414b542dba14d71a3f0b9f6fd2abce715b9f5912d082800563e6c806d1 |
| turbo-cache-control | no-preview |
| diff-view | unified |
| go-import | github.com/simstudioai/sim git https://github.com/simstudioai/sim.git |
| octolytics-dimension-user_id | 199344406 |
| octolytics-dimension-user_login | simstudioai |
| octolytics-dimension-repository_id | 912559512 |
| octolytics-dimension-repository_nwo | simstudioai/sim |
| octolytics-dimension-repository_public | true |
| octolytics-dimension-repository_is_fork | false |
| octolytics-dimension-repository_network_root_id | 912559512 |
| octolytics-dimension-repository_network_root_nwo | simstudioai/sim |
| turbo-body-classes | logged-out env-production page-responsive |
| disable-turbo | true |
| browser-stats-url | https://api.github.com/_private/browser/stats |
| browser-errors-url | https://api.github.com/_private/browser/errors |
| release | cbf66c024bb6d10e6955baa7413c54cf13a201bb |
| ui-target | full |
| theme-color | #1e2327 |
| color-scheme | light dark |
Links:
Viewport: width=device-width