7 Commits

Author SHA1 Message Date
a238b7e35f Add comprehensive error handling system
- Add extended error types with severity levels, retry policies,
  and contextual information (types/errors.ts)
- Create centralized error handler service with user-friendly
  message translation and classification (services/errorHandler.ts)
- Add ErrorContext for global error state management with
  auto-dismiss and error queue support (contexts/ErrorContext.tsx)
- Create error UI components: ErrorToast, FieldError,
  FieldErrorSummary, FullScreenError, EmptyState, OfflineState
- Add useError hook with retry strategies and API response handling
- Add useAsync hook for async operations with comprehensive state
- Create error message utilities with validation helpers
- Add tests for errorHandler and errorMessages (88 tests)

🤖 Generated with [Claude Code](https://claude.com/claude-code)

Co-Authored-By: Claude <noreply@anthropic.com>
2026-01-31 17:43:07 -08:00
5a6c80533e Add comprehensive WiFi credentials validation
Implement WiFi SSID and password validation following IEEE 802.11 standards:

Features:
- SSID validation: length (max 32 bytes), control characters, whitespace warnings
- Password validation for WPA/WPA2/WPA3 (8-63 chars), WEP, and Open networks
- Weak password detection with warnings
- Non-ASCII character warnings
- Input sanitization (trim SSID, preserve password spaces)
- User-friendly error messages

Integration:
- Added validation to wifi-setup.tsx (ESP provisioning flow)
- Added validation to setup-wifi.tsx (batch sensor setup flow)
- Pre-provisioning validation with error/warning alerts
- Password requirements hints in UI

Tests:
- Comprehensive test suite with 42 test cases
- 100% coverage of validation logic
- Tests for all auth types (WPA, WEP, Open)
- Edge cases and warning scenarios

🤖 Generated with [Claude Code](https://claude.com/claude-code)

Co-Authored-By: Claude <noreply@anthropic.com>
2026-01-31 16:55:27 -08:00
91e677178e Add offline mode graceful degradation
Implements comprehensive offline handling for API-first architecture:

Network Detection:
- Real-time connectivity monitoring via @react-native-community/netinfo
- useNetworkStatus hook for React components
- Utility functions: getNetworkStatus(), isOnline()
- Retry logic with exponential backoff

Offline-Aware API Layer:
- Wraps all API methods with network detection
- User-friendly error messages for offline states
- Automatic retries for read operations
- Custom offline messages for write operations

UI Components:
- OfflineBanner: Animated banner at top/bottom
- InlineOfflineBanner: Non-animated inline version
- Auto-shows/hides based on network status

Data Fetching Hooks:
- useOfflineAwareData: Hook for data fetching with offline handling
- useOfflineAwareMutation: Hook for create/update/delete operations
- Auto-refetch when network returns
- Optional polling support

Error Handling:
- Consistent error messages across app
- Network error detection
- Retry functionality with user feedback

Tests:
- Network status detection tests
- Offline-aware API wrapper tests
- 23 passing tests with full coverage

Documentation:
- Complete offline mode guide (docs/OFFLINE_MODE.md)
- Usage examples (components/examples/OfflineAwareExample.tsx)
- Best practices and troubleshooting

🤖 Generated with [Claude Code](https://claude.com/claude-code)

Co-Authored-By: Claude <noreply@anthropic.com>
2026-01-31 16:49:15 -08:00
54336986ad Improve serial number validation with comprehensive testing
Added robust serial validation with support for multiple formats:
- Production format: WELLNUO-XXXX-XXXX (strict validation)
- Demo serials: DEMO-00000 and DEMO-1234-5678
- Legacy format: 8+ alphanumeric characters with hyphens

Frontend improvements (activate.tsx):
- Real-time validation feedback with error messages
- Visual error indicators (red border, error icon)
- Proper normalization (uppercase, trimmed)
- Better user experience with clear error messages

Backend improvements (beneficiaries.js):
- Enhanced serial validation on activation endpoint
- Stores normalized serial in device_id field
- Better logging for debugging
- Consistent error responses with validation details

Testing:
- 52 frontend tests covering all validation scenarios
- 40 backend tests ensuring consistency
- Edge case handling (long serials, special chars, etc.)

Code quality:
- ESLint configuration for test files
- All tests passing
- Zero linting errors
2026-01-29 11:33:54 -08:00
74a4c9e8f4 Fix avatar caching after upload with cache-busting
Implemented cache-busting mechanism to prevent stale avatar images
after upload. React Native Image component caches images by URI,
causing old avatars to persist even after successful upload.

Changes:
- Added bustImageCache() utility function in utils/imageUtils.ts
- Appends timestamp query parameter (?t=timestamp) to avatar URLs
- Skips cache-busting for local file://, data: URIs and placeholders
- Applied bustImageCache() to all avatar Image components:
  - Beneficiary detail screen (header, edit modal, lightbox)
  - Beneficiary list cards on dashboard
- Ensured loadBeneficiary() is called after avatar upload completes
- Added comprehensive unit tests for cache-busting logic

Backend already generates unique URLs with timestamps when uploading
to MinIO, but this ensures frontend always requests fresh images.

🤖 Generated with [Claude Code](https://claude.com/claude-code)

Co-Authored-By: Claude <noreply@anthropic.com>
2026-01-29 11:22:49 -08:00
Sergei
d453126c89 feat: Room location picker + robster credentials
- Backend: Update Legacy API credentials to robster/rob2
- Frontend: ROOM_LOCATIONS with icons and legacyCode mapping
- Device Settings: Modal picker for room selection
- api.ts: Bidirectional conversion (code ↔ name)
- Various UI/UX improvements across screens

PRD-DEPLOYMENT.md completed (Score: 9/10)

🤖 Generated with [Claude Code](https://claude.com/claude-code)

Co-Authored-By: Claude <noreply@anthropic.com>
2026-01-24 15:22:40 -08:00
Sergei
7105bb72f7 Stable Light version - App Store submission
WellNuo Lite architecture:
- Simplified navigation flow with NavigationController
- Profile editing with API sync (/auth/profile endpoint)
- OTP verification improvements
- ESP WiFi provisioning setup (espProvisioning.ts)
- E2E testing infrastructure (Playwright)
- Speech recognition hooks (web/native)
- Backend auth enhancements

This is the stable version submitted to App Store.

🤖 Generated with [Claude Code](https://claude.com/claude-code)

Co-Authored-By: Claude <noreply@anthropic.com>
2026-01-12 20:28:18 -08:00