feat(ios): enhance recovery logging and metrics recording

Implement comprehensive logging and observability for recovery operations:

- Add HistoryDAO for Core Data history recording
  - recordRecovery() method with execution time tracking
  - recordRecoveryFailure() method with detailed error info
  - Query helpers for history retrieval
- Enhance DailyNotificationReactivationManager logging:
  - Add execution time tracking (startTime/endTime)
  - Enhanced error logging with NSError details (domain, code, userInfo)
  - Comprehensive logging at each recovery step
  - Missed/future notification count logging
- Implement Core Data persistence for recovery metrics:
  - Recovery execution time
  - Missed notification count
  - Rescheduled notification count
  - Verified notification count
  - Error count
  - Diagnostic JSON with full recovery context
- Update recovery methods to record history:
  - Cold start recovery
  - Termination recovery
  - Boot recovery
  - All with timing and metrics

Completes section 7.1 (Recovery Logging) and 7.2 (Metrics Recording)
of iOS implementation checklist.
This commit is contained in:
Matthew
2025-12-09 02:37:27 -08:00
parent a90d08c425
commit 12d8536588
3 changed files with 442 additions and 44 deletions

View File

@@ -356,24 +356,24 @@ Complete checklist of iOS code that needs to be implemented for feature parity w
### 7.1 Recovery Logging
- [ ] Add comprehensive logging:
- [ ] `DNP-REACTIVATION: Starting app launch recovery`
- [ ] `DNP-REACTIVATION: Detected scenario: [scenario]`
- [ ] `DNP-REACTIVATION: Missed notifications detected: [count]`
- [ ] `DNP-REACTIVATION: Future notifications verified: [count]`
- [ ] `DNP-REACTIVATION: Recovery completed: [result]`
- [ ] Add error logging:
- [ ] `DNP-REACTIVATION: Recovery failed (non-fatal): [error]`
- [ ] Include error details and stack trace
- [x] Add comprehensive logging:
- [x] `DNP-REACTIVATION: Starting app launch recovery`
- [x] `DNP-REACTIVATION: Detected scenario: [scenario]`
- [x] `DNP-REACTIVATION: Missed notifications detected: [count]`
- [x] `DNP-REACTIVATION: Future notifications verified: [count]`
- [x] `DNP-REACTIVATION: Recovery completed: [result]`
- [x] Add error logging:
- [x] `DNP-REACTIVATION: Recovery failed (non-fatal): [error]`
- [x] Include error details and stack trace (NSError domain, code, userInfo)
### 7.2 Metrics Recording
- [ ] Record recovery metrics in history table:
- [ ] Recovery execution time
- [ ] Missed notification count
- [ ] Rescheduled notification count
- [ ] Error count
- [ ] Add diagnostic JSON to history entries
- [x] Record recovery metrics in history table:
- [x] Recovery execution time (tracked with startTime/endTime)
- [x] Missed notification count
- [x] Rescheduled notification count
- [x] Error count
- [x] Add diagnostic JSON to history entries (via HistoryDAO.recordRecovery)
---