Skip to content

Tracker timestamps map

This quick map summarizes which tracker timestamp fields are updated by which services and how they are used in the fetch + geofence pipelines.

Summary table

Field Updated by Used by Primary purpose Notes
last_report_received services/tracker_fetcher_2/taskiq_service.py (_update_last_report_received) app/api/routes/trackers/listing.py, app/crud/tracker.py Track the latest report timestamp per tracker Used for listing sort/filter and "active trackers" query.
last_processed_at services/tracker_fetcher_2/taskiq_service.py (_update_tracker_processed_timestamp), services/unified_geofence_service/taskiq_service.py (_update_tracking_fields) Fetcher queue logic Fair scheduling and staleness tracking Used for batch ordering and queue scoring.
last_status_check services/tracker_status_service/service.py (status updates), services/unified_geofence_service/taskiq_service.py (_update_tracking_fields) services/tracker_status_service/service.py Track when status was last evaluated Used to skip reprocessing older location data.
current_state_start services/tracker_status_service/service.py, services/unified_geofence_service/taskiq_service.py Analytics + status history When the current status began Set to triggering location timestamp.
last_report_requested No current writers found No current readers found Legacy or future use Field exists in model/schema; not referenced in services.
last_position_report No current writers found No current readers found Legacy or future use Field exists in model/schema; not referenced in services.

Pipeline sketch (text diagram)

FindMy fetcher (tracker_fetcher_2)
  -> inserts location_reports
  -> updates trackers.last_report_received
  -> updates trackers.last_processed_at (fair scheduling)
  -> schedules unified geofence processing

Unified geofence service
  -> reads location_reports
  -> determines tracker status + geofence events
  -> updates trackers.current_status, current_state_start
  -> updates trackers.last_status_check, last_processed_at
  -> writes status_history + geofence_events

Tracker status service (legacy batch path)
  -> reads location_history (materialized view)
  -> updates trackers.current_status, current_state_start
  -> updates trackers.last_status_check
  -> writes status_history

Key takeaways

  • Operationally active fields: last_report_received, last_processed_at, last_status_check, current_state_start.
  • last_report_requested and last_position_report appear unused in current services.