- Implement slug uniqueness check before creating user
- Add numeric suffix if slug already exists (e.g., username1, username2)
- Fallback to timestamp-based slug if too many collisions
- Prevents database constraint violations for duplicate slugs
- Matches the logic used in OAuth service for consistency
- Set Role to 'user' explicitly
- Set IsActive to true explicitly
- Set IsVerified to false explicitly
- Prevents database constraint errors when creating new users
- Ensures all required fields are set even if database defaults are missing
- Add user-friendly error messages for password, email, and username validation
- Translate technical validation errors to clear French messages
- Specifically handle 'min' validation for password (12 chars) and username (3 chars)
- Handle 'eqfield' validation for password confirmation
- Handle 'email' validation for email format
- Handle 'required' validation for all fields
- Improves error messages shown to users during registration
- Disable RegisterRateLimit when APP_ENV=development
- Add development mode check in endpoint_limiter.go
- Prevents rate limit errors during development and testing
- Endpoint rate limiting still active in production/staging
- Fixes 429 errors when creating accounts in development
- Disable rate limiting when APP_ENV=development
- Add development mode check in router.go
- Prevents rate limit errors during development and testing
- Rate limiting still active in production/staging
- Exclude critical routes as backup measure
- Exclude auth routes (/register, /login, /refresh) from rate limiting
- Exclude CSRF token endpoint from rate limiting
- Exclude health check endpoints from rate limiting
- Exclude Swagger/docs endpoints from rate limiting
- Prevents rate limit errors during registration and login
- Applied to both SimpleRateLimiter and RateLimiter (Redis)
- Increase IP rate limit from 100 to 200 requests per minute
- Increase IP burst from 10 to 20
- Increase SimpleRateLimiter limit from 100 to 200
- Allows frontend to make multiple requests during initial load (CSRF, state hydration, etc.)
- Can be overridden via RATE_LIMIT_IP_PER_MINUTE and RATE_LIMIT_LIMIT env vars
Frontend fixes:
- Stop retrying 429 rate limit errors to prevent infinite loops
- Show user-friendly error message for rate limit with retry-after duration
- Remove 429 from retryable status codes
- Clean up rate limit error handling logic
Backend fixes:
- Fix Swagger /docs route to use same handler as /swagger/*any
- Remove redirect that was causing 404 errors
Frontend fixes:
- Fix 'require is not defined' error in stateHydration.ts
Replace require('react') with ES6 import statement
- Fix DataCloneError in broadcastSync.ts
Serialize state before sending via BroadcastChannel (functions can't be cloned)
Backend fixes:
- Fix Swagger /docs route not found
Redirect /docs to /swagger/index.html for better compatibility
- Change :userId to :id in avatar routes for consistency
- Fixes panic: ':userId' conflicts with existing wildcard ':id'
- All routes now use consistent :id parameter
- Fix 050_data_validation_constraints.sql: Replace IF NOT EXISTS with DO blocks
- PostgreSQL doesn't support IF NOT EXISTS with ADD CONSTRAINT
- Add quick troubleshooting guide (DEPANNAGE_RAPIDE.md)
- Note: .env file is gitignored (as expected)
- Created comprehensive unit tests for marketplaceService (11 tests)
- Created comprehensive unit tests for profileService (12 tests)
- Created comprehensive unit tests for avatarService (9 tests)
- Created comprehensive unit tests for 2fa-service (8 tests)
- All 40 tests pass successfully
- Tests cover success cases, error handling, edge cases, and validation scenarios
Files modified:
- apps/web/src/services/marketplaceService.test.ts (new)
- apps/web/src/features/profile/services/profileService.test.ts (new)
- apps/web/src/features/profile/services/avatarService.test.ts (new)
- apps/web/src/services/2fa-service.test.ts (new)
- VEZA_COMPLETE_MVP_TODOLIST.json
- Created APIMonitoringMiddleware to track API failures (5xx errors), slow requests, and timeouts
- Created HealthCheckMonitoring middleware for health check endpoints
- Integrated MonitoringAlertingService into router with automatic initialization
- Service starts monitoring in background with default alert rules
- Provides comprehensive monitoring and alerting for API health and failures
- Monitoring activates when PROMETHEUS_URL is configured
Files modified:
- veza-backend-api/internal/middleware/monitoring.go (new)
- veza-backend-api/internal/api/router.go
- VEZA_COMPLETE_MVP_TODOLIST.json
- Created DeprecationInfo structure for managing deprecation metadata
- Enhanced DeprecationWarning middleware with custom deprecation information support
- Added standardized deprecation headers (Deprecated, Sunset, Link per RFC 8594)
- Added X-API-* custom headers for compatibility
- Created MarkEndpointDeprecated helper for easy endpoint deprecation
- System provides clear warnings, sunset dates, and migration guidance
Files modified:
- veza-backend-api/internal/middleware/general.go
- VEZA_COMPLETE_MVP_TODOLIST.json
- Created ValidateRequiredEnvironmentVariables function
- Validates required vars (JWT_SECRET, DATABASE_URL) in all environments
- Production-specific validations: CORS_ALLOWED_ORIGINS required, no wildcard, no DEBUG log level, RabbitMQ URL if enabled
- Integrated validation at startup in NewConfig() to fail-fast if required variables are missing
- Provides clear error messages for missing or invalid environment variables
Files modified:
- veza-backend-api/internal/config/config.go
- VEZA_COMPLETE_MVP_TODOLIST.json
- Enhanced ValidateCORSConfiguration to accept environment parameter
- Enforce strict validation in production (fail-fast on wildcard or empty CORS)
- In production, startup fails if CORS is misconfigured
- In development/staging, warnings are logged but startup continues
- Updated router to use environment-aware validation
Files modified:
- veza-backend-api/internal/middleware/cors.go
- veza-backend-api/internal/api/router.go
- VEZA_COMPLETE_MVP_TODOLIST.json
- Fixed GetSessions handler to identify current session by comparing token hash
- Added session creation during token refresh to ensure sessions are tracked
- Sessions are now correctly identified as current in the frontend
- Updated Refresh handler to accept sessionService parameter
Files modified:
- veza-backend-api/internal/handlers/session.go
- veza-backend-api/internal/handlers/auth.go
- veza-backend-api/internal/api/router.go
- VEZA_COMPLETE_MVP_TODOLIST.json
- Created comprehensive filtering and sorting test suite
- Tests cover tracks endpoints: filtering by user_id, genre, format, combined filters
- Tests cover tracks endpoints: sorting by created_at (asc/desc), title, default sort
- Tests cover users endpoints: filtering by role, is_active, is_verified, search
- Tests cover users endpoints: sorting by created_at, username
- Tests cover playlists endpoints: filtering by user_id
- Tests verify invalid sort fields and orders are handled gracefully
- Tests verify combined filtering and sorting work together
- Note: User search test skipped for SQLite (does not support ILIKE operator)
Phase: PHASE-5
Priority: P2
Progress: 141/267 (52.81%)
- Created k6 load test script for concurrent and chunked uploads
- Added Go performance tests for upload endpoints
- Updated README with usage instructions for upload load tests
- Tests cover simple upload, chunked upload (initiate/chunk/complete), and batch upload
- Performance thresholds defined for upload operations
Phase: PHASE-5
Priority: P2
Progress: 136/267 (50.94%)