Skip to content

Fix broken dashboard meal logs and recipe browsing - #1

Closed
cursor[bot] wants to merge 3 commits into
mainfrom
cursor/critical-correctness-bugs-e5ae
Closed

Fix broken dashboard meal logs and recipe browsing#1
cursor[bot] wants to merge 3 commits into
mainfrom
cursor/critical-correctness-bugs-e5ae

Conversation

@cursor

@cursor cursor Bot commented May 14, 2026

Copy link
Copy Markdown

Summary

  • Fix dashboard meal-log loading by unwrapping the backend paginated response and querying the supported daily date filter.
  • Restore backend recipe list/search endpoints used by the frontend Recipes page, and route searched browsing to /recipes/search.
  • Update the health test fixture to mock the ML health dependency covered by the health route.

Bug and impact

  • The dashboard treated { items, nextCursor, hasMore } as a MealLog[], causing a runtime crash when meal logs loaded; it also sent stripped startDate/endDate params, so totals could be calculated from the wrong logs.
  • The Recipes page called /api/v1/recipes and /api/v1/recipes/search, but those routes were missing, so recipe browsing/search returned 404/422 instead of user-facing recipe results.

Root cause

  • Frontend API types drifted from the backend meal-log pagination contract.
  • The backend had recipe service methods but did not expose matching list/search routes, while /recipes/search could fall through to the UUID detail route.

Fix and validation

  • Added focused backend/frontend tests for the meal-log and recipe API contracts.
  • Ran pnpm --filter @snacktrack/backend test (49 tests passed).
  • Ran pnpm --filter @snacktrack/frontend test (14 tests passed).
  • Ran DATABASE_URL=postgresql://localhost:5432/snacktrack_test DIRECT_URL=postgresql://localhost:5432/snacktrack_test pnpm --filter @snacktrack/backend build.
  • Ran pnpm --filter @snacktrack/frontend build.
Open in Web View Automation 

cursoragent and others added 3 commits May 14, 2026 11:03
Co-authored-by: Vasanth Panuganti <vpanuga2@asu.edu>
Co-authored-by: Vasanth Panuganti <vpanuga2@asu.edu>
Co-authored-by: Vasanth Panuganti <vpanuga2@asu.edu>
@vasanthpanuganti
vasanthpanuganti deleted the cursor/critical-correctness-bugs-e5ae branch June 11, 2026 05:53
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.

2 participants