Hi team, we launched our rudderstack implementatio...
# support
b
Hi team, we launched our rudderstack implementation this week and opened the experiment this morning, we found that right now out of 58 events 38 events have failed, 65% of events. On the sample failed event we see it's a timestamp issue, could you please help us fix this? We do not add timestamp from our client side so, maybe it is some of config that we are doing in wrong way?
k
Hey @boundless-notebook-34527 , Which SDK are you using ?
👋 1
b
I am using iOS SDK
k
In iOS we get time from device itself, can you please check if the device time is accurate ?
b
Oh it will be tricky to do that because it's in production devices, could timezone also affect it? In uat we were able to get data correctly
Currently around 40% of events are only being sent successfully
but sample size is still small
k
It might be possible that the user has updated the time in their device
b
Ok but is this time converted to UTC form by SDK already? Our users are mainly in Bangkok, I wanted to make sure if locale or timezone can affect the SDK or not
k
Yes, SDK would convert the date and time to UTC format. Ideally locale or timezone shouldn’t affect as the SDK converts them to the UTC format. In this case the issue seems to be occurring due to the change in the device time by the user
Hey @boundless-notebook-34527, We had tested by setting the timezone to Indochina time (Bangkok) and found that events are sent with the valid timestamps. Also, whatever the timezone the user was in, SDK would convert the time to UTC, and send them to Rudderstack, so timezone shouldn’t be an issue.
I am not really sure, if the image attached below would be a reason why majority of users are ~15 minutes ahead, but a quick google search lead me to this
CC <!subteam^S04QT1G74Q3|@sdk-team>
b
@kind-carpenter-27609 Thank you so much for your investigations, would it be possible to fix this either in SDK or outside, maybe for Thai locale the time is compensated by 15 minutes only for these users with varied time?
c
I don’t think, if it is possible to do anything in this case, as the SDK fetches the time from the device itself.
k
Hey @boundless-notebook-34527, Nothing much can be done from the SDK’s end at the moment. But you can leverage our transformations feature to fix this issue
👍 2
c
Hey @boundless-notebook-34527, You may use this sample transformation code snippet to handle the timestamp issue using the transformation doc shared above:
Copy code
const buddhistTimestamp = "2566-03-09T03:26:19.873Z";
const [buddhistYear, month, day, hour, minute, second] = buddhistTimestamp.split(/[^0-9]/);
const gregorianYear = parseInt(buddhistYear) - 543;
const date = new Date(Date.UTC(gregorianYear, month - 1, day, hour, minute, second));
const isoTimestamp = date.toISOString();

console.log(isoTimestamp); // Output: 2023-03-09T03:26:19.873Z
FYI: We are also internally discussing about how to provide a solution for this issue.
k
Hey @boundless-notebook-34527, Did you get a chance to try the transformations feature ? Also, the issue you are facing is due to the buddhist calendar set in the end user’s device. We are having a solution for this in v1 of iOS SDK and we are providing a fix for v2 as well very soon. Will let you know once we release v2 with the fix
b
@kind-carpenter-27609 Hi, Thank you for follow up. We are amidst our beta launch sprint so, currently we are focusing on the MVP version for our beta-customers without much focus on analytics. Due to other tasks and bug fixes POs have not prioritized the transformations yet but we are planning on going with transformation route so, we will do that until v2 is out, please keep me posted. I will inform my team. For now until first week of April I think all focus will be on beta-launch only.
k
Okay got that, we would be releasing the fix for v2 of april by then and you can pick it up once you start working on the Analytics part of the app.
🙌 1
Hey @boundless-notebook-34527, We had released version 2.2.7 of the iOS SDK with the fix for the above issue, please take a look at this and let us know if this fix solves your issue.
🙌 1
b
@kind-carpenter-27609 Thank you so much, we are updating to the new SDK now, we are assuming the SDK for android is also updated with similar change right?
k
@boundless-notebook-34527, please let us know how this goes once you update the iOS SDK to version 2.2.7 and regarding android we are not having this timestamp issue on it, so we are good.
c
Hey @boundless-notebook-34527, Can you please let us know if you’re still facing the issue or not?
b
@calm-yak-10773 We have not released app with SDK update yet because POs are prioritizing other tasks so, I cannot still confirm on production for the SDK but we also have transformation to fix timestamp in place at the moment so, there is no issue for now. I will update in this thread after the SDK update is released and we have results.
👍 1