Performance, Stability & RAG Pipeline
Major infrastructure improvements covering database performance, API stability, and a new export endpoint designed for downstream RAG pipelines such as PIM AI Coach.
NewNew export endpoint (GET /api/export/documents) for RAG pipeline integration with language filtering (?lang=ENG) and incremental sync (?since=timestamp)
NewCORS support for cross-origin access from pim-a-icoach.vercel.app and pim-ai-global.vercel.app
NewAPI pagination with limit/offset support on record listing (default 500, max 500)
NewGlobal error boundary with retry button for graceful error recovery
ImprovedAdded database indexes on policy tiers, countries, auth tables, and audit logs for faster queries
ImprovedAdded foreign key constraint from policy records to countries table to enforce data integrity
ImprovedSwitched record detail and edit pages from force-dynamic to ISR (60s revalidation) for better caching
ImprovedAdded Cache-Control headers to single record API endpoint
ImprovedZod validation schema now enforces max string lengths to reject oversized payloads
ImprovedRate limiting on export endpoint (10 requests per minute per IP)
FixedFixed document upsert race condition by replacing DELETE+INSERT with INSERT ON CONFLICT DO UPDATE
FixedAdded 30-second timeout on blob storage fetch to prevent hanging downloads
FixedFixed blob deletion order — now deletes blob before database record to prevent orphaned files
FixedAdded try-catch to JSON.parse in upload route to prevent crashes from malformed client payloads
FixedFixed SSR hydration issue with window.history access in record form cancel button
FixedCountryCombobox now shows error state instead of infinite spinner on network failure
FixedStrengthened blob URL hostname validation with exact subdomain structure check
FixedFixed parseInt NaN handling in query parameter parsing for tier filters