Validate filter membership values - #30
Conversation
|
@codex review |
There was a problem hiding this comment.
💡 Codex Review
Here are some automated review suggestions for this pull request.
Reviewed commit: b83ceba586
ℹ️ About Codex in GitHub
Your team has set up Codex to review pull requests in this repo. Reviews are triggered when you
- Open a pull request for review
- Mark a draft as ready
- Comment "@codex review".
If Codex has suggestions, it will comment; otherwise it will react with 👍.
Codex can also answer questions or update the PR. Try commenting "@codex address that feedback".
| parsed.forEach((filter, index) => | ||
| validateAnalyticsFilter(filter, `--filters[${index}]`, true), | ||
| ) |
There was a problem hiding this comment.
Validate filters carried inside analytics params
When filters are supplied through pipe-specific --params—for example funnel's steps[*].filters, or flow's global_filters and step filters—this validation is never invoked because the --params branch serializes nested objects unchanged. Consequently a membership value such as ["alpha|beta"] is still sent to Tinybird and produces the API 400 this change is intended to catch locally; apply the delimiter validation to these documented filter-bearing params as well.
Useful? React with 👍 / 👎.
Summary
--filtersentry against the canonical{field, op, value}envelope|characters in Tinybird-backed analytics and segment membership arraysWhy
Tinybird membership values use
|as their transport separator and cannot decode a literal pipe inside an array member losslessly. The public API now documents and rejects that input. The CLI should fail locally with an actionable error instead of forwarding an invalid request and returning an API 400.Validation
pnpm test- 165 passing, 18 live/integration tests skippedpnpm typecheckpnpm lintpnpm buildNeed help on this PR? Tag
@codesmith-botwith what you need. Autofix is disabled.