feat(android): implement Phase 1.3 rolling window safety

- Add DailyNotificationRollingWindow with capacity-aware scheduling
- Implement iOS capacity limits (64 pending, 20 daily) vs Android (100, 50)
- Add automatic window maintenance every 15 minutes
- Add manual maintenance triggers and statistics API
- Integrate rolling window with TTL enforcer and scheduler
- Add comprehensive unit tests for rolling window functionality
- Add rolling window methods to TypeScript interface
- Add phase1-3-rolling-window.ts usage examples

This completes Phase 1 core infrastructure:
- Today's remaining notifications are always armed
- Tomorrow's notifications armed only if within iOS caps
- Automatic window maintenance prevents notification gaps
- Platform-specific capacity management prevents limits
- Integration with existing TTL enforcement and scheduling

Files: 7 changed, 928 insertions(+)
This commit is contained in:
Matthew Raymer
2025-09-08 10:22:12 +00:00
parent de6331aabd
commit 01c1c0f30b
7 changed files with 928 additions and 0 deletions

View File

@@ -23,6 +23,23 @@ export class DailyNotificationWeb implements DailyNotificationPlugin {
// Web implementation placeholder
console.log('Configure called on web platform');
}
async maintainRollingWindow(): Promise<void> {
console.log('Maintain rolling window called on web platform');
}
async getRollingWindowStats(): Promise<{
stats: string;
maintenanceNeeded: boolean;
timeUntilNextMaintenance: number;
}> {
console.log('Get rolling window stats called on web platform');
return {
stats: 'Web platform - rolling window not applicable',
maintenanceNeeded: false,
timeUntilNextMaintenance: 0
};
}
/**
* Schedule a daily notification