Commit Graph

5 Commits

Author SHA1 Message Date
Antoni Nuñez Romeu ee23f61057 fix(backend): improve OFF API error handling
Run Tests on Branches / Detect Changes (push) Successful in 9s
Run Tests on Branches / Frontend Tests (push) Has been cancelled
Run Tests on Branches / Frontend Mobile Tests (push) Has been cancelled
Run Tests on Branches / Backend Tests (push) Has started running
- Validate response is JSON before parsing (OFF returns HTML on 503)
- Don't cache empty results to avoid blocking future searches
- Add validateStatus to only accept 200 responses
- Better logging for API failures
2026-07-13 16:23:07 +02:00
Antoni Nuñez Romeu 26f309acfb fix(backend): switch OFF API to /cgi/search.pl endpoint and fix test imports
Run Tests on Branches / Detect Changes (push) Successful in 8s
Run Tests on Branches / Frontend Tests (push) Has been cancelled
Run Tests on Branches / Frontend Mobile Tests (push) Has been cancelled
Run Tests on Branches / Backend Tests (push) Has been cancelled
- Changed from /api/v2/search (returning 503) to /cgi/search.pl (working)
- Removed strict categories_tags=baby-food filter that was too restrictive
- Fixed test file to use dynamic imports for ES module compatibility
- Increased timeout to 10s for reliability
2026-07-13 16:18:11 +02:00
Antoni Nuñez Romeu 981f3bd3db fix: address code review issues — nutriscore field name, cache write isolation, missing rate limiter, dead props 2026-07-13 15:46:47 +02:00
Antoni Nuñez Romeu d62e5976ce fix: remove dead BABY_CATEGORIES constant and emoji from logs 2026-07-13 15:17:02 +02:00
Antoni Nuñez Romeu d6f4164dae feat(backend): add Open Food Facts service with Redis caching
- transformOFFProduct: maps OFF products to unified Product model
- searchBabyProducts: searches baby products via OFF API (1h cache)
- getBabyProductDetails: fetches product details by barcode (1h cache)
- 9 tests passing for transform logic and input validation
2026-07-13 15:10:46 +02:00