Q: How to fix two Zwift events with overlapping times

TotalWhitefish1 month ago

I have received two payloads for a Zwift user within an hour of eachother, however both payloads start at the same timestamp 2024-03-05T09:30:32 but different end times. Why is this the case? I can provide the full payload separately if it helps


Alexadmin1 month ago

Hey there. After looking into this, it seems that the first payload was sent when Zwift autosaved the cycling session and the second event was sent after the session had finished. Regardless, both events can be unified by looking at the metadata.summary_id property which you can use to overwrite the old payload in your database.

Whilst most activity events are only sent once after completion, occasionally a provider may send a half-complete event pre-maturely determining the end of the exercise or sometimes a correction payload might be sent updating certains values or after recalculating scores. In either case, the best practice is to use the summary_id property to unify the data.