Files
daily-notification-plugin/test-apps/android-test-app
Matthew Raymer 1053b668d0 test(phase1): automate TEST 4 invalid data handling verification
Implements automated testing for TEST 4 (Invalid Data Handling) to verify
recovery gracefully handles invalid database entries without crashing.

Changes:
- Add injectInvalidTestData plugin method for injecting invalid test data
  (empty schedule IDs, null nextRunAt, empty notification IDs)
- Make test app debuggable to enable direct database access
- Enhance test-phase1.sh with automated database injection and verification:
  * Detect debuggable app status (check for DEBUGGABLE flag)
  * Inject invalid data via direct SQL (schedules and notifications)
  * Handle WAL mode with checkpoint
  * Verify data injection success
  * Trigger recovery and check logs for "Skipping invalid" messages
  * Report pass/fail/inconclusive results

Fixes database constraint issues discovered during testing:
- Include jitterMs and backoffPolicy in schedule inserts
- Include priority, vibration_enabled, sound_enabled in notification inserts

Test results:  PASSED
- Invalid data successfully injected
- Cold start recovery correctly skips invalid entries
- Recovery completes without crashing
- Boot recovery processes invalid data (follow-up improvement needed)

This enables automated verification that recovery handles corrupted or
invalid database entries gracefully, preventing crashes in production.
2025-12-08 07:06:00 +00:00
..