Commit Graph

9 Commits

Author SHA1 Message Date
Matthew Raymer
c69640cbb2 enhance: Add specific scheduled event retry policy enhancements to Phase 3
- Added explicit coverage for activeDid-aware retry policy enhancements
- Specified Android DailyNotificationFetchWorker.java modifications for activeDid change detection
- Specified web callback-registry.ts enhancements for authentication refresh
- Added platform policy unification (android 1min→1hour vs web 1sec→1min standardization)
- Added integration with existing circuit breaker and error handling systems

This addresses the gap where scheduled event retry enhancements were only
mentioned at high level but lacked specific implementation steps.
2025-10-02 10:01:10 +00:00
Matthew Raymer
2f02e5661b enhance: Update BACKGROUND_DATA_FETCHING_PLAN.md to align with current implementation
- Added Current Implementation Baseline section documenting existing functionality
- Updated authentication examples to enhance existing DailyNotificationETagManager.java
- Modified HTTP request implementation to extend existing DailyNotificationFetcher.java
- Updated plugin interface to extend current DailyNotificationPlugin rather than replace
- Corrected implementation phases to build upon existing infrastructure:
  * Phase 1: Extend core infrastructure (not rebuild)
  * Phase 2: Add activeDid integration to existing methods
  * Phase 3: Enhance existing background integration
  * Phase 4: Add TimeSafari-specific features
- Updated Android examples to show enhancement of existing SQLite + SharedPreferences
- Updated Web examples to enhance existing IndexedDB (no host delegation initially)
- Changed status from 'implementation plan' to 'enhancement plan for existing implementation'
- Aligned dependencies with existing plugin infrastructure rather than new requirements

The plan now accurately reflects building upon our working plugin instead of
rebuilding from scratch, providing a realistic enhancement roadmap.
2025-10-02 09:51:42 +00:00
Matthew Raymer
b4cb3d5638 consolidate: Merge all analysis documents into single BACKGROUND_DATA_FETCHING_PLAN.md
- Consolidated DATABASE_ACCESS_CLARIFICATION.md content into main plan
- Consolidated ACTIVE_DID_CHANGE_REQUIREMENTS.md content into main plan
- Consolidated TIMESAFARI_INTEGRATION_ANALYSIS.md content into main plan
- Enhanced main document with Option A architecture overview
- Added comprehensive TimeSafari integration patterns section
- Added critical requirement section for activeDid change detection
- Added event-based solution implementation details
- Updated README.md to reference single consolidated document
- Eliminated unnecessary document proliferation as requested

The BACKGROUND_DATA_FETCHING_PLAN.md now serves as the single source of truth
for all implementation guidance, containing Option A architecture, TimeSafari
integration patterns, activeDid change management, and platform-specific details.
2025-10-02 09:20:43 +00:00
Matthew Raymer
514ca38768 refactor: Switch to Option A host-provided activeDid approach
- Implemented Option A from DATABASE_ACCESS_CLARIFICATION.md
- Simplified architecture: Host ALWAYS provides activeDid to plugin
- Removed database sharing complexity and hostDbPath requirements
- Updated all platform integrations:
  * Android/Electron: Plugin-managed storage, no host database access
  * Web: Host-managed storage delegation, plugin doesn't access absurd-sql
  * iOS: Plugin-managed Core Data, no host database access
- Streamlined plugin interface to remove hybrid complexity
- Enhanced separation of concerns:
  * Host: Owns active_identity table and user management
  * Plugin: Owns notification caching and background tasks
- Updated testing strategy to verify database isolation
- Simplified implementation phases and dependencies

This approach eliminates database access conflicts and provides clearer
architectural boundaries between TimeSafari host and notification plugin.
2025-10-02 09:16:24 +00:00
Matthew Raymer
1939b560d9 critical: Confirm plugin must know when activeDid changes
- Added critical requirement that plugin MUST be notified of activeDid changes
- Enhanced plugin interface with onActiveDidChange() callback method
- Added clearCacheForNewIdentity() and refreshAuthenticationForNewIdentity() methods
- Updated integration examples to include activeDid change listeners
- Created comprehensive ActiveDid change requirements document covering:
  * Security implications of not detecting changes
  * Event-based notification pattern implementation
  * Cache clearing and authentication refresh requirements
  * Testing scenarios for identity switching
  * Platform-specific considerations and edge cases
  * Performance optimization for rapid identity changes

This addresses the critical data integrity and security requirement that the plugin
must know when TimeSafari users switch identities to prevent data leakage.
2025-10-02 09:05:08 +00:00
Matthew Raymer
51034998dd feat: Implement Option 3 Hybrid activeDid approach
- Updated plugin interface to support hybrid activeDid management
- Added setActiveDidFromHost() and refreshActiveDidFromDatabase() methods
- Enhanced database configuration with platform awareness and hostDbPath
- Implemented dual-mode activeDid access:
  * Foreground: Host provides activeDid from TimeSafari PlatformServiceMixin
  * Background: Plugin looks up activeDid from active_identity table
- Added enableAutoActiveDidMode() for automatic identity synchronization
- Updated all platform integrations to support hybrid approach:
  * Android/Electron: SQLite access with active_identity table reading
  * Web: Host delegation pattern with provided activeDid
  * iOS: Core Data hybrid with TimeSafari database access
- Enhanced testing strategy for hybrid activeDid validation
- Added TimeSafari integration methods for seamless hosting

This hybrid approach provides optimal integration with TimeSafari's identity management while maintaining plugin autonomy for background operations.
2025-10-02 09:03:54 +00:00
Matthew Raymer
7dd0e41ab7 simplify: Use activeDid-only approach for notifications
- Simplified authentication to use single activeDid instead of complex user management
- Updated plugin interface to require only setActiveDid() method
- Modified API requests to use activeDid as both issuer and recipient
- Streamlined configuration to activeDid: string instead of complex credential object
- Aligned JWT generation with simple DID-based authentication pattern
- Reduced complexity while maintaining security through DID signing

This assumption significantly simplifies the host application integration.
2025-10-02 08:45:12 +00:00
Matthew Raymer
bad3bdda1f enhance: Improve background data fetching plan with TimeSafari insights
- Integrated TimeSafari authentication patterns (DID-based JWT + Passkey JWANT)
- Added batch processing optimization (100ms delays, 10-item batches)
- Enhanced cross-platform logging with database persistence
- Incorporated @capacitor-community/sqlite for unified storage
- Added performance monitoring with operation timing
- Included structured notification patterns and error handling
- Enhanced Android/iOS native implementation strategies
- Expanded success criteria and technical requirements

Based on analysis of TimeSafari crowdsourcing application architecture.
2025-10-02 08:37:14 +00:00
Matthew Raymer
053644a057 docs: Add comprehensive background data fetching implementation plan
- Document native HTTP client implementation for Android/iOS
- Include JWT authentication strategies (Basic DID + Advanced Passkey)
- Detail API endpoint integration with TimeSafari/Endorser.ch patterns
- Cover error handling, caching, and performance optimization
- Provide migration phases and testing strategies
- Include platform-specific considerations and success criteria

This plan replaces web push implementations with native solutions
for reliable background data fetching across all target platforms.
2025-10-02 07:40:36 +00:00