تخطَّ إلى المحتوى
توثيق المطورين

Location history and sampling

What gets stored, what gets charged, and why a successful ingest can return history_written=false.

Location history and sampling

What gets stored, what gets charged, and why a successful ingest can return history_written=false.

Tracking ingest accepts every valid position, but Location History stores keyframes rather than every event. The two behaviours are separate on purpose: live state and realtime stay exact, while history stays small enough to read quickly and cheaply.

When a position becomes a history keyframe

After the first point of a session, a position is written to history when any of these server-side gates is met:

  • The position is at least 200 m from the last keyframe.
  • At least 60 seconds have elapsed since the last keyframe.
  • The heading changed by at least 45 degrees from the last keyframe heading.

Only GOOD or DEGRADED accuracy fixes may add a keyframe, where an accuracy of up to 250 m counts as GOOD and a missing accuracy is treated as GOOD. These are server-side defaults: a client-side sampling choice cannot force a keyframe, and raising your send rate does not increase history resolution.

What each operation costs

OperationEffectCharged
Send a locationLive state, and a history keyframe only when a gate is metOne Tracking Point
Retry the same client_event_idNo additional state or history effectNothing
Read latest stateCurrent position onlyNothing extra
Read historySampled keyframes onlyOne History Read credit in the Free Sandbox
Send a heartbeatLiveness state only, no locationNothing

Rejected, malformed and duplicate events do not consume a Tracking Point. That asymmetry is deliberate: a device that retries aggressively after a network failure must not be able to spend a wallet.

Designing around it

  • Do not reconstruct a path from the stream alone: stream frames are live, and history is sampled.
  • To measure a trip distance, use the history keyframes or the route returned by Directions, and say which one you used.
  • If you need every point, store them on your own side as they are accepted. Bardiya deliberately does not keep a raw event log.
  • Tune your own send cadence for battery and bandwidth, not for history resolution: the gates decide that.