Skip to content

Food search: distinct error state, stale-response guard, USDA 429 -> 503 - #14

Merged
KrishP147 merged 3 commits into
mainfrom
krish/fix-food-search-errors
Sep 24, 2026
Merged

KrishP147 merged 3 commits into
mainfrom
krish/fix-food-search-errors

Conversation

@KrishP147

Copy link
Copy Markdown
Owner

Fixes #5

  • FoodSearchInput: failed searches show "Search unavailable, try again" (role=alert) instead of "No foods found"; empty-result copy only after a successful response. AbortController signal + request-id ref drop stale responses; cancelled requests never set the error. "Add manually" kept in both panels.
  • search-food / food-details edge functions: USDA 429 -> 503 with a clear detail; console.warn when falling back to DEMO_KEY.
  • Tests: +4 (error panel, empty-success, stale guard w/ deferred promises + abort assertion, cancel shows no error). 146/146 locally.

Note: edge-function TS is not type-checked in CI yet (no deno step; tracked in #10).

🤖 Generated with Claude Code

KrishP147 and others added 3 commits September 23, 2026 22:03
Co-Authored-By: Claude Opus 5.5 (1M context) <noreply@anthropic.com>
…nses

Co-Authored-By: Claude Opus 5.5 (1M context) <noreply@anthropic.com>
Co-Authored-By: Claude Opus 5.5 (1M context) <noreply@anthropic.com>
Copilot AI lite review requested due to automatic review settings September 24, 2026 02:29
@vercel

vercel Bot commented Sep 24, 2026 •

Copy link
Copy Markdown

The latest updates on your projects. Learn more about Vercel for GitHub.

Project Deployment Actions Updated
nutrisync-frontend Ready Ready Preview Sep 24, 2026 2:29am UTC

Copilot AI left a comment

Copy link
Copy Markdown

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Copilot was unable to review this pull request because the user who requested the review has reached their quota limit.

@KrishP147
KrishP147 merged commit d093fb2 into main Sep 24, 2026
8 checks passed
@codecov

codecov Bot commented Sep 24, 2026

Copy link
Copy Markdown

Codecov Report

❌ Patch coverage is 95.83333% with 1 line in your changes missing coverage. Please review.

Files with missing lines Patch % Lines
frontend/src/components/FoodSearchInput.jsx 95.83% 1 Missing ⚠️

📢 Thoughts on this report? Let us know!

This branch was successfully deployed

1 active deployment
Preview — fcd9e965 Deployed Sep 24, 2026 by vercel[bot]
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

Food search: backend errors shown as 'No foods found'; stale responses overwrite results

2 participants