segmentio / analytics-react-native

The hassle-free way to add analytics to your React-Native app.
https://segment.com/docs/sources/mobile/react-native/
MIT License
367 stars 191 forks source link

Events from the future #977

Closed alinuxr closed 3 months ago

alinuxr commented 3 months ago

Problem: Getting events from the future, e.g getting JSON like that { "body": { "sentAt": "2024-05-21T00:08:54.551Z", "timestamp": "2024-06-04T11:36:12.799Z", "writeKey": "key", "type": "track", "event": "open", "properties": { "screen": "HOME", "type": "SCREEN", "code": "HOME", "name": "name", "navigation": "HOME" }, "messageId": "id", "integrations": {}, "anonymousId": "id", "userId": "[id1,id2,id3]", "context": { "app": { "build": "201206017", "name": "name", "namespace": "namespace", "version": "2.16.3" }, "device": { "manufacturer": "HONOR", "model": "NTH-NX9", "name": "HNNTH", "type": "android" }, "library": { "name": "@segment/analytics-react-native", "version": "2.19.1" }, "locale": "ru-RU", "network": { "cellular": false, "wifi": true }, "os": { "name": "Android", "version": "13" }, "screen": { "width": 1080, "height": 2238, "density": 2.549999952316284 }, "timezone": "Asia/Yakutsk", "traits": { "latitude": 56.6524461, "longitude": 124.7141545 }, "instanceId": "id" } }, "remote_address": "ip", "client": "", "path": "/api/event-tracker/public/v1/collect", "queryParams": {} }

In documentation found information

For client-side tracking it’s possible for the client to spoof the originalTimeStamp, which may result in a calculated timestamp value set in the future.

Questions: How we can hadle this? Why there is no originalTimestamp field?

Steps to reproduce

Expected behavior no events from the future with big time difference (we have incidents with 1 month difference)

Actual behavior events from the future

alanjcharles commented 3 months ago

Hi @alinuxr please reach out to friends@segment.com with this report for assistance with this issue. They will be able to go over your options and help you troubleshoot your implementation. Thank you