Skip to content

Conversation

@JohnPalmer
Copy link
Contributor

This pull request refactors report and background track syncing to support offline persistence and retries. It also restores device-side background track masking (even though the tracks are also being masked by the API), and it includes documentation showing history of background tracking approaches (necessary for adjusting models based on changes to the code over time). Finally, updates iOS project configuration.

Background tracking and offline syncing improvements:

  • Added a comprehensive historical and technical reference for background tracking and sampling strategies in docs/background_tracking_history.md, including requirements, implementation status, and validation steps.
  • Refactored background tracking to ensure five random fixes per day are captured, masked, and persisted locally until acknowledged by the server, with automatic retries when connectivity is restored. The new logic is centralized in lib/utils/BackgroundTracking.dart and integrated via lib/main.dart and related files. [1] [2] [3] [4]
  • Updated callbackDispatcher and UI flows to invoke syncPendingFixes on startup and after tracking configuration, ensuring pending background location samples are reliably synced. [1] [2] [3]

Report syncing and offline queue integration:

  • Introduced ReportSyncService to support queuing and syncing of user reports when offline, replacing direct API calls in various controllers and pages. This ensures reports are not lost due to connectivity issues and are retried automatically. [1] [2] [3] [4] [5] [6] [7]

iOS project configuration and build settings:

  • Updated the iOS project (ios/Runner.xcodeproj/project.pbxproj and ios/Runner/Info.plist) to use the correct bundle identifier (cat.ibeji.tigatrapp), changed the development team to 6MGZ4KYJ2V, and added missing framework dependencies for new features. This aligns the build with production requirements and resolves provisioning/profile issues. [1] [2] [3] [4] [5] [6] [7] [8] [9]

These changes collectively improve reliability, maintainability, and production readiness for background tracking and report syncing.

…locally and syncing when connectivity is restored.

- Removed direct API calls from BiteReportController and BreedingSiteReportController.
- Integrated ReportSyncService for handling report submissions and queuing when offline.
- Added error handling and success dialogs for report submissions.
- Created new service (report_sync_service.dart) to manage pending reports and sync them with the server.
- Updated BackgroundTracking to include functionality for syncing pending fixes.
- Adjusted dependencies in pubspec.yaml and updated pubspec.lock for path_provider.
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

2 participants