Expose extended promotional component filter#340
Conversation
There was a problem hiding this comment.
💡 Codex Review
Here are some automated review suggestions for this pull request.
Reviewed commit: 700929238f
ℹ️ 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".
| query = query.where("preferred", "=", 1) | ||
| } | ||
| if (req.query.is_extended_promotional) { | ||
| query = query.where("preferred", "=", 1).where("basic", "=", 0) |
There was a problem hiding this comment.
Use null-safe predicate for extended promotional filter
The new is_extended_promotional filter currently uses where("basic", "=", 0), but v_components.basic is nullable (see lib/db/generated/kysely.ts), while the response flag is computed as !Boolean(c.basic). That means rows with preferred = 1 and basic = NULL are labeled is_extended_promotional: true in normal responses but are incorrectly excluded when is_extended_promotional=true is requested. This creates inconsistent and incomplete filtered results for /components/list whenever basic is null.
Useful? React with 👍 / 👎.
There was a problem hiding this comment.
Fixed in 3621305: the origin filters now use preferred = 1 plus COALESCE(basic, 0) = 0, matching the response !Boolean(basic) behavior. Verified with bun test, bunx tsc --noEmit, and bun run format:check.
|
@codex review |
|
Codex Review: Didn't find any major issues. Can't wait for the next one! ℹ️ About Codex in GitHubYour team has set up Codex to review pull requests in this repo. Reviews are triggered when you
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". |
1 similar comment
|
Codex Review: Didn't find any major issues. Can't wait for the next one! ℹ️ About Codex in GitHubYour team has set up Codex to review pull requests in this repo. Reviews are triggered when you
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". |
Summary
is_extended_promotionalderived frompreferred && !basicto origin/components/listand/api/searchresponsesis_extended_promotional=truefiltering to origin and D1 search/catalog pathsVerification
bun run setupbun test(213 pass, 0 fail)bunx tsc --noEmitbun run format:checkcd cf-proxy && bun test(126 pass, 0 fail)git diff --checkDemo
/claim #92