microsoft / appcenter-sdk-android

Development repository for the App Center SDK for Android
Other
277 stars 134 forks source link

Track event wrong timestamp #1558

Closed diogosapessoa closed 2 years ago

diogosapessoa commented 2 years ago

Description

When the device's system time is incorrect, Analytics.TrackEvent saves timestamp incorrect too

Repro Steps

  1. Change time in device's settings
  2. Call Analytics.TrackEvent(...)

Details

  1. Which SDK version are you using?
    • 4.3.1
  2. Which OS version did you experience the issue on?
    • e.g. Android 6.0.1
  3. What device version did you see this error on? Were you using an emulator or a physical device?
    • Galaxy J2 Prime SM-G532M
  4. What third party libraries are you using?
    • None

Question

Old versions used SystemClock.elapsedRealtime() and calculate correct time?

AnastasiaKubova commented 2 years ago

Hi! Thanks for getting in touch with us! Also could you please describe your issue in more detail? What do you mean by system time is incorrect? App Center SDK sets date for log here. So if system time will changes that in logs time will be the same.

diogosapessoa commented 2 years ago

Utc now is 08/10/2021 10:04:28 -03:00 and i can change to 07/10/2021 10:04:28 -03:00 in device settings SDK will send to backend and register as yesterday event But my application doesn't use system time because is unreliable and i know the right current date and time truetime It would be possible to give a way in SDK to set the timestamp of the event?

AnastasiaKubova commented 2 years ago

Thanks for the details. I got it. We already have the same feature request about it so I am closing this issue. Please track it here.