Repository navigation
feat: allow up to 10,000 filter keys per column in team settings - #3657
Conversation
|
The latest updates on your projects. Learn more about Vercel for GitHub.
|
🦋 Changeset detectedLatest commit: 7e23d4b The changes in this PR will be included in the next version bump. This PR includes changesets to release 4 packages
Not sure what this means? Click here to learn what changesets are. Click here if you're a maintainer who wants to add another changeset to this PR |
E2E Test Results✅ All tests passed • 480 passed • 1 skipped • 1072s
Tests ran across 4 shards in parallel. |
🔵 Tier 2 — Low RiskSmall, isolated change with no API route or data model modifications. Why this tier:
Additional context: spans packages but only 15 prod lines — under the 100-line cross-layer bar Review process: AI review + quick human skim (target: 5–15 min). Reviewer validates AI assessment and checks for domain-specific concerns. Stats
|
Duplicate code analysis5 new clones introduced by this PR.
If one of these duplicates a helper that already exists, import it instead jscpd compared this branch against |
PR Review
1 finding(s): 🔴 0 P0/P1 · 🟡 1 P2 · 🔵 0 P3 1 posted as inline comment(s) on the changed lines. Priority comes from a separate grading pass over the finished review. P3 is folded here instead of posted inline. No finding blocks merge automatically; a maintainer decides. |
Deep Review✅ No critical issues found. This is a small, well-tested change: it raises the 🟡 P2 — recommended
🔵 P3 nitpicks (2)
Reviewers (5): correctness, testing, maintainability, performance, typescript. Testing gaps: No finding blocks merge automatically. A maintainer will expect P0/P1 findings in code this PR changes to be fixed; P2/P3 are your call -- fix or reply. Never fix findings about surrounding code here; reply instead. Do not widen the PR. How to respond |
accc11e to
89236c5
Compare
| const isFieldMetadataDisabled = !!me?.team?.fieldMetadataDisabled; | ||
| // The team setting only raises Map key discovery, so a low limit doesn't | ||
| // shrink the keys offered to autocomplete and the other field pickers. | ||
| const maxKeys = Math.max(useFilterKeysFetchLimit(), DEFAULT_MAX_KEYS); |
There was a problem hiding this comment.
🟡 P2 — Team limit now reaches getMapKeys unchecked, so a non-integer value from the API blanks every field for the table
Tighten filterKeysFetchLimit in TeamClickHouseSettingsUpdateSchema (packages/common-utils/src/types.ts:2704) to z.number().int().min(1).max(10000). Optionally also round or clamp maxKeys here. The 10,000 cap currently exists only as the HTML max on the settings input. Before this PR, Map key discovery always used 1000. Now the raw team value goes through getAllFields into getMapKeys, whose inlineNonNegativeInt(maxKeys) (packages/common-utils/src/core/metadata.ts:178, 1162) throws on non-integers. PUT /team/clickhouse-settings accepts any number. So {filterKeysFetchLimit: 1500.5} makes getAllFields reject. useMultipleAllFields then returns fields: [], which drops even the top-level columns from autocomplete and the field pickers. A huge value such as 1e7 also goes straight into the ClickHouse LIMIT and groupUniqArrayArray(N).
Advisory. Fix if it is a small defect in code this PR changes; otherwise reply in the thread. Do not widen the PR or touch files it did not already change. How to respond
89236c5 to
7e23d4b
Compare
Summary
Increases the max limit of number of keys that can be loaded.
References
Stack created with GitHub Stacks CLI • Give Feedback 💬