Repository navigation
feat: validate non-empty search query in Grok-backed columns - #78
Merged
Merged
Conversation
The x-search, news-search, facebook, instagram, and google-news columns passed config.query straight to their fetchers without guarding against empty or whitespace-only input. Empty queries triggered wasted Grok API calls that returned an opaque error instead of a clear message. Trim the query and throw "Search query is required." when blank — the same guard farcaster and bing already use. Passing the trimmed value also keeps leading/trailing whitespace out of the upstream search. Co-Authored-By: Claude Opus 4.8 <noreply@anthropic.com>
aaronjmars
added a commit
that referenced
this pull request
Jun 23, 2026
…, youtube (#79) These four moded social/search columns passed config.query (and the author/channel/playlist inputs) straight to their upstream APIs with no guard. An empty or whitespace-only value fired a wasted request — a Grok web_search call for linkedin, an AppView/Mastodon/YouTube fetch for the rest — that came back as an opaque upstream error instead of a clear 'input required' message. Brings them in line with farcaster and the github-* columns, which already trim-and-throw on their required input. Continues PR #78, which fixed the same class of bug across the five Grok-backed search columns but didn't cover these. - linkedin: throw on empty query (Grok-backed, single required input) - bluesky/mastodon: throw on empty query in search/hashtag mode and on empty handle in author mode - youtube: throw on empty query/channel/playlist per mode Co-authored-by: aeonframework <aeonframework@proton.me> Co-authored-by: Claude Opus 4.8 <noreply@anthropic.com>
aaronjmars
added a commit
that referenced
this pull request
Jun 24, 2026
…#80) * docs(plugins): teach required-input validation in the column template PRs #78/#79 added trim-and-throw guards for required inputs across the Grok-backed and moded social columns, but the `_template/` every new column is copied from — and the plugin contract README — never taught the pattern. A contributor scaffolding a new column inherits the exact gap those two PRs closed: Zod `.default("")` guarantees a field is present and typed, but not non-empty, so an empty query fires a wasted upstream call that returns an opaque error instead of a clear "X is required." - _template/server.ts: document the guard at the top of `fetch`, with the canonical `config.query.trim()` check and a note that the hello-world demo intentionally skips it. Comment-only — the template still runs as-is. - lib/columns/README.md: correct step 4 ("present" is not "non-empty") and add a "Validate required inputs" convention with the exact pattern and the note that a throw is caught by the shared API route as the column error state. Co-Authored-By: Claude Opus 4.8 <noreply@anthropic.com> * docs(plugins): scope the required-input convention to what code actually does Soften "every input-driven column" — the query-driven github columns (search/issues/prs/backlinks) don't guard, only the repo-based ones do — and correct the error surface: a thrown error becomes a fetch-error toast, not an inline column error state. Co-Authored-By: Claude Opus 4.8 (1M context) <noreply@anthropic.com> --------- Co-authored-by: aeonframework <aeonframework@proton.me> Co-authored-by: Claude Opus 4.8 <noreply@anthropic.com>
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Add this suggestion to a batch that can be applied as a single commit.This suggestion is invalid because no changes were made to the code.Suggestions cannot be applied while the pull request is closed.Suggestions cannot be applied while viewing a subset of changes.Only one suggestion per line can be applied in a batch.Add this suggestion to a batch that can be applied as a single commit.Applying suggestions on deleted lines is not supported.You must change the existing code in this line in order to create a valid suggestion.Outdated suggestions cannot be applied.This suggestion has been applied or marked resolved.Suggestions cannot be applied from pending reviews.Suggestions cannot be applied on multi-line comments.Suggestions cannot be applied while the pull request is queued to merge.Suggestion cannot be applied right now. Please check back later.
What
Five search-backed columns —
x-search,news-search,facebook,instagram, andgoogle-news— now reject empty or whitespace-only queries with a clearSearch query is required.error before any upstream call, and pass the trimmed query downstream.Why
These columns forwarded
config.querystraight to their fetchers with no guard. A blank query fired a wasted Grok API call (xAI spend) that came back as an opaque failure, leaving the user with no idea what went wrong. The siblingfarcasterandbingcolumns already trim-and-throw on empty input — this brings the rest of the search columns in line with that established pattern.Changes
lib/columns/plugins/x-search/server.ts: trim query, throw on empty, pass trimmed value togrokXSearchlib/columns/plugins/news-search/server.ts: same guard beforegrokNewsSearchlib/columns/plugins/facebook/server.ts: same guard beforegrokFacebookSearchlib/columns/plugins/instagram/server.ts: same guard beforefetchInstagramlib/columns/plugins/google-news/server.ts: same guard before building the Google News RSS URLBuilt autonomously by Aeon