docs: Consolidate documentation structure (139 files, zero information loss)

Consolidate all markdown documentation into organized structure per
CONSOLIDATION_DIRECTIVE. All files preserved (canonical, merged, or archived).

- docs/integration/ - Integration documentation (7 files)
- docs/platform/ios/ - iOS platform docs (12 files)
- docs/platform/android/ - Android platform docs (9 files)
- docs/testing/ - Testing documentation (15 files)
- docs/design/ - Design & research (5 files)
- docs/ai/ - AI/ChatGPT artifacts (7 files)
- docs/archive/2025-legacy-doc/ - Historical docs (17 files)

- Integration: Root INTEGRATION_GUIDE.md → docs/integration/
- Platform: Separated iOS and Android into platform/ subdirectories
- Testing: Consolidated all testing docs to docs/testing/
- Legacy: Archived entire doc/ directory to archive/
- AI: Moved all ChatGPT artifacts to docs/ai/

- Added docs/00-INDEX.md - Central navigation hub
- Added docs/CONSOLIDATION_SOURCE_MAP.md - Complete audit trail
- Added docs/CONSOLIDATION_COMPLETE.md - Consolidation summary
- Updated README.md with links to documentation index

- All 139 files have destinations (see CONSOLIDATION_SOURCE_MAP.md)
- Zero information loss (all files preserved)
- Archive preserves original structure
- Index provides clear navigation

- 87 files moved/created/updated
- Root-level docs consolidated
- Legacy doc/ directory archived
- Test app docs remain with test apps (indexed)

Ref: CONSOLIDATION_DIRECTIVE
Author: Matthew Raymer
This commit is contained in:
Matthew Raymer
2025-12-18 09:12:11 +00:00
parent 37fd2629d1
commit c39bd7cec6
78 changed files with 720 additions and 18 deletions

View File

@@ -0,0 +1,280 @@
# Testing Quick Reference - P0 Production-Grade Features
## Current Version Features
**P0 Priority 1**: Channel Management (ChannelManager)
**P0 Priority 2**: PendingIntent & Exact Alarms (PendingIntentManager)
**P0 Priority 3**: JIT Freshness Re-check (Soft TTL)
**P0 Priority 4**: Recovery Coexistence (RecoveryManager)
## Quick Test Commands
### 1. Basic Functionality Test
```bash
# Launch app
adb shell am start -n com.timesafari.dailynotification/.MainActivity
# Check channel status
adb shell "dumpsys notification | grep -A5 daily_default"
# Check alarms
adb shell "dumpsys alarm | grep timesafari"
# Check exact alarm permission
adb shell "dumpsys alarm | grep SCHEDULE_EXACT_ALARM"
```
### 2. Channel Management Test
```bash
# Check channel exists and is enabled
adb shell "dumpsys notification | grep daily_default"
# Check channel importance (should be 3 = IMPORTANCE_HIGH)
adb shell "dumpsys notification | grep -A5 daily_default | grep importance"
# Open channel settings
adb shell "am start -a android.settings.CHANNEL_NOTIFICATION_SETTINGS -e android.provider.extra.APP_PACKAGE com.timesafari.dailynotification -e android.provider.extra.CHANNEL_ID daily_default"
```
### 3. PendingIntent & Exact Alarms Test
```bash
# Check PendingIntent flags in alarms
adb shell "dumpsys alarm | grep -A10 -B5 timesafari"
# Check exact alarm permission
adb shell "dumpsys alarm | grep SCHEDULE_EXACT_ALARM"
# Open exact alarm settings
adb shell "am start -a android.settings.REQUEST_SCHEDULE_EXACT_ALARM -d package:com.timesafari.dailynotification"
```
### 4. JIT Freshness Re-check Test
```bash
# Clear logs
adb logcat -c
# Schedule notification in app UI, then monitor logs
adb logcat | grep -i "jit\|freshness\|stale"
# Look for:
# - "Content is fresh (age: X minutes), skipping JIT refresh"
# - "Content is stale (age: X minutes), attempting JIT refresh"
# - "JIT refresh succeeded" or "JIT refresh failed, using original content"
```
### 5. Recovery Coexistence Test
```bash
# Clear logs
adb logcat -c
# Launch app multiple times to test cooldown
adb shell am start -n com.timesafari.dailynotification/.MainActivity
sleep 2
adb shell am start -n com.timesafari.dailynotification/.MainActivity
sleep 2
adb shell am start -n com.timesafari.dailynotification/.MainActivity
# Check recovery logs
adb logcat -d | grep -i "recovery.*requested.*app_startup"
adb logcat -d | grep -i "recovery.*performed.*recently.*skipping"
```
### 6. Reboot Recovery Test
```bash
# Schedule notification in app UI first
# Then reboot
adb reboot
# Wait for boot
adb wait-for-device
sleep 30
# Check recovery logs
adb logcat -d | grep -i "recovery.*requested.*boot_completed"
# Check alarms restored
adb shell "dumpsys alarm | grep timesafari"
```
## Automated Test Scripts
### Comprehensive Test Suite
```bash
# Run comprehensive test suite
./scripts/comprehensive-test-v2.sh
```
### Reboot Test Suite
```bash
# Run reboot test suite
./scripts/reboot-test-v2.sh
```
### Python Test Suite
```bash
# Run Python test suite
python3 scripts/daily-notification-test.py
```
## Expected Log Patterns
### Channel Management
```
ChannelManager: Creating new notification channel: daily_default
ChannelManager: Notification channel created with IMPORTANCE_HIGH
```
### PendingIntent & Exact Alarms
```
PendingIntentManager: Scheduled exact alarm with setExactAndAllowWhileIdle
PendingIntentManager: AlarmStatus{exactAlarmsSupported=true, exactAlarmsGranted=true}
```
### JIT Freshness Re-check
```
DailyNotificationReceiver: Content is fresh (age: 5 minutes), skipping JIT refresh
DailyNotificationReceiver: Content is stale (age: 7 hours), attempting JIT refresh
DailyNotificationReceiver: JIT refresh succeeded, using fresh content
```
### Recovery Coexistence
```
RecoveryManager: Recovery requested from: APP_STARTUP
RecoveryManager: Recovery performed recently (2s ago), skipping
RecoveryManager: Recovery requested from: BOOT_COMPLETED
RecoveryManager: Recovery completed from BOOT_COMPLETED: 3/5 recovered, 2 skipped
```
## Success Criteria
### ✅ All Tests Pass When:
1. **Channel Management**:
- Channel exists with ID `daily_default`
- Channel importance is `IMPORTANCE_HIGH` (3)
- Channel blocking detection works
- Settings deep linking works
2. **PendingIntent & Exact Alarms**:
- PendingIntent uses `FLAG_UPDATE_CURRENT | FLAG_IMMUTABLE`
- Exact alarm permission detection works
- Settings deep linking works
- Alarms schedule correctly
3. **JIT Freshness Re-check**:
- Fresh content (< 6 hours) skips refresh
- Stale content (> 6 hours) attempts refresh
- Graceful fallback on refresh failure
- Original content preserved on failure
4. **Recovery Coexistence**:
- App startup recovery works
- Boot recovery works
- 5-minute cooldown prevents duplicate recovery
- Recovery statistics tracked correctly
- State persisted in SharedPreferences
### ❌ Tests Fail When:
- Channel not created or blocked
- PendingIntent flags incorrect
- JIT refresh not working
- Recovery operations conflict
- Boot recovery not triggered
- Alarms not restored after reboot
## Troubleshooting Commands
### Debug Channel Issues
```bash
# Check channel status
adb shell "dumpsys notification | grep -A10 daily_default"
# Check channel importance
adb shell "dumpsys notification | grep -A5 daily_default | grep importance"
```
### Debug Alarm Issues
```bash
# Check scheduled alarms
adb shell "dumpsys alarm | grep timesafari"
# Check exact alarm permission
adb shell "dumpsys alarm | grep SCHEDULE_EXACT_ALARM"
# Check alarm manager state
adb shell "dumpsys alarm | head -20"
```
### Debug Recovery Issues
```bash
# Check recovery logs
adb logcat -d | grep -i "recovery.*requested"
# Check recovery state
adb shell "run-as com.timesafari.dailynotification ls -la /data/data/com.timesafari.dailynotification/shared_prefs/"
# Check boot receiver registration
adb shell "dumpsys package com.timesafari.dailynotification | grep -A5 -B5 receiver"
```
### Debug JIT Freshness Issues
```bash
# Check JIT refresh logs
adb logcat -d | grep -i "jit\|freshness\|stale"
# Check content age calculation
adb logcat -d | grep -i "age.*minutes"
```
## Manual Testing Checklist
### Pre-Test Setup
- [ ] Device/emulator connected via ADB
- [ ] App installed and permissions granted
- [ ] Notification permissions enabled
- [ ] Exact alarm permissions granted (Android 12+)
### Basic Tests
- [ ] App launches successfully
- [ ] Plugin loads without errors
- [ ] Channel created with correct settings
- [ ] Notifications schedule correctly
- [ ] Notifications appear at scheduled time
### P0 Feature Tests
- [ ] Channel management works
- [ ] PendingIntent flags correct
- [ ] Exact alarm permission detection
- [ ] JIT freshness re-check works
- [ ] Recovery coexistence works
- [ ] Boot recovery works
### Edge Case Tests
- [ ] App background notification
- [ ] App closed notification
- [ ] Force stop (expected failure)
- [ ] Reboot recovery
- [ ] Multiple notifications
- [ ] Network connectivity issues
### Performance Tests
- [ ] Memory usage stable
- [ ] CPU usage reasonable
- [ ] No memory leaks
- [ ] Efficient recovery operations
## Quick Status Check
```bash
# One-liner to check all systems
echo "=== Channel Status ===" && adb shell "dumpsys notification | grep -A3 daily_default" && echo "=== Alarm Status ===" && adb shell "dumpsys alarm | grep timesafari" && echo "=== Recovery Status ===" && adb logcat -d | grep -i "recovery.*requested" | tail -3
```
This quick reference covers all the essential testing procedures for the current P0 production-grade version of the DailyNotification plugin.