# Daily Notification Plugin - TODO Items

**Last Updated**: 2025-11-06  
**Status**: Active tracking of pending improvements and features

---

## 🔴 High Priority

### 1. Add Instrumentation Tests
**Status**: In Progress  
**Priority**: High  
**Context**: Expand beyond basic `ExampleInstrumentedTest.java`

**Tasks**:
- [x] Create comprehensive instrumentation test suite
- [x] Test alarm scheduling and delivery
- [x] Test BroadcastReceiver registration
- [x] Test alarm status checking
- [x] Test alarm cancellation
- [x] Test unique request codes
- [ ] Test notification display (requires UI testing)
- [ ] Test prefetch mechanism (requires WorkManager testing)
- [ ] Test permission handling edge cases
- [ ] Test offline scenarios

**Location**: `test-apps/daily-notification-test/android/app/src/androidTest/java/com/timesafari/dailynotification/NotificationInstrumentationTest.java`

**Reference**: `doc/android-app-improvement-plan.md` - Phase 2: Testing & Reliability

**Completed**: Created `NotificationInstrumentationTest.java` with tests for:
- NotifyReceiver registration verification
- Alarm scheduling with setAlarmClock()
- Unique request code generation
- Alarm status checking (isAlarmScheduled)
- Next alarm time retrieval
- Alarm cancellation
- PendingIntent uniqueness

---

### 2. Update Documentation
**Status**: ✅ Completed  
**Priority**: High  
**Context**: Documentation needs updates for recent changes

**Tasks**:
- [x] Update API reference with new methods (`isAlarmScheduled`, `getNextAlarmTime`, `testAlarm`)
- [x] Document NotifyReceiver registration requirements
- [x] Update AndroidManifest.xml examples
- [x] Document alarm scheduling improvements (`setAlarmClock()`)
- [x] Add troubleshooting guide for BroadcastReceiver issues
- [ ] Update integration guide with Vue test app setup

**Completed**: Updated documentation in:
- `API.md`: Added new diagnostic methods with examples
- `README.md`: Added Android diagnostic methods section, emphasized NotifyReceiver requirement
- `doc/notification-testing-procedures.md`: Added troubleshooting for BroadcastReceiver issues, diagnostic method usage

**Reference**: `doc/android-app-improvement-plan.md` - Phase 3: Security & Performance

---

## 🟡 Medium Priority

### 3. Phase 2 Platform Implementation
**Status**: Pending  
**Priority**: Medium  
**Context**: Complete platform-specific implementations per specification

**Android Tasks**:
- [ ] WorkManager integration improvements
- [ ] SQLite storage implementation (shared database)
- [ ] TTL enforcement at notification fire time
- [ ] Rolling window safety mechanisms
- [ ] ETag support for content fetching

**iOS Tasks**:
- [ ] BGTaskScheduler implementation
- [ ] UNUserNotificationCenter integration
- [ ] Background task execution
- [ ] T–lead prefetch logic

**Storage System**:
- [ ] SQLite schema design with TTL rules
- [ ] WAL (Write-Ahead Logging) mode
- [ ] Shared database access pattern
- [ ] Hot-read verification for UI

**Callback Registry**:
- [ ] Full implementation with retries
- [ ] Redaction support for sensitive data
- [ ] Webhook delivery mechanism
- [ ] Error handling and recovery

**Reference**: `doc/implementation-roadmap.md` - Phase 2 details

---

### 4. Performance Optimization
**Status**: Pending  
**Priority**: Medium  
**Context**: Optimize battery usage and system resources

**Tasks**:
- [ ] Battery optimization recommendations
- [ ] Network request optimization
- [ ] Background execution efficiency
- [ ] Memory usage optimization
- [ ] CPU usage profiling

**Reference**: `code-summary-for-chatgpt.md` - Production Readiness Checklist

---

### 5. Security Audit
**Status**: Pending  
**Priority**: Medium  
**Context**: Security hardening review

**Tasks**:
- [ ] Permission validation review
- [ ] Input sanitization audit
- [ ] Network security review
- [ ] Storage encryption review
- [ ] JWT token handling security

**Reference**: `code-summary-for-chatgpt.md` - Production Readiness Checklist

---

## 🟢 Low Priority / Nice-to-Have

### 6. iOS Implementation Completion
**Status**: Pending  
**Priority**: Low  
**Context**: Complete iOS platform implementation

**Tasks**:
- [ ] BGTaskScheduler registration
- [ ] Background task handlers
- [ ] UNUserNotificationCenter integration
- [ ] UserDefaults storage improvements
- [ ] Background App Refresh handling

**Reference**: `code-summary-for-chatgpt.md` - Production Readiness Checklist

---

### 7. Monitoring and Analytics
**Status**: Pending  
**Priority**: Low  
**Context**: Add observability and metrics

**Tasks**:
- [ ] Structured logging improvements
- [ ] Health monitoring endpoints
- [ ] Success rate tracking
- [ ] Latency metrics
- [ ] Error distribution tracking

**Reference**: `doc/directives/0001-Daily-Notification-Plugin-Implementation-Directive.md`

---

### 8. User Documentation
**Status**: Pending  
**Priority**: Low  
**Context**: End-user documentation

**Tasks**:
- [ ] User guide for notification setup
- [ ] Troubleshooting guide for users
- [ ] Battery optimization instructions
- [ ] Permission setup guide

**Reference**: `code-summary-for-chatgpt.md` - Production Readiness Checklist

---

### 9. Production Deployment Guide
**Status**: Pending  
**Priority**: Low  
**Context**: Deployment procedures

**Tasks**:
- [ ] Production build configuration
- [ ] Release checklist
- [ ] Rollback procedures
- [ ] Monitoring setup guide

**Reference**: [DEPLOYMENT_CHECKLIST.md](../deployment/DEPLOYMENT_CHECKLIST.md)

---

## 📝 Notes

- **CI/CD**: Excluded from this list per project requirements
- **Current Focus**: High priority items (#1 and #2)
- **Recent Completion**: NotifyReceiver registration fix (2025-11-06)
- **Verification**: Notification system working in both test apps

---

**Related Documents**:
- `doc/android-app-improvement-plan.md` - Detailed improvement plan
- `doc/implementation-roadmap.md` - Implementation phases
- [DEPLOYMENT_CHECKLIST.md](../deployment/DEPLOYMENT_CHECKLIST.md) - Deployment procedures
- `test-apps/daily-notification-test/TODO_NATIVE_FETCHER.md` - Native fetcher TODOs

