You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
On iOS group createdAt (which is supposed to be unix timestamp or milliseconds since 1970) always ends in three 0s on iOS. The same can be seen for the sent field on group messages which should also be the millisecond unix timestamp.
An example from the log would be, Android logging:
LOG Group createdAt: 1708614527922
LOG Conversation createdAt: 1708614528344
LOG Group message sent: 1708614547377
LOG Conversation message sent: 1708614547353
while iOS would log:
LOG Group createdAt: 1708614407000
LOG Conversation createdAt: 1708614407244
LOG Group message sent: 1708614407000
LOG Conversation message sent: 1708614407820
This would mess up the order of things in automated tests, and when streaming messages quickly.
This is strange because the code looks like it should break for Conversations and Groups, but somehow the precision looks fine for Conversations. Relevant code for taking timestamps from the xmtp-ios SDK and converting them into a JSON object that is imported into React Native typescript can be seen below:
Notice they all use a similar syntax UInt64(conversation.createdAt.timeIntervalSince1970 * 1000) vs UInt64(group.createdAt.timeIntervalSince1970 * 1000),
So I belive the question should be where in xmtp-ios are the group.createdAt and message.sent fields being handled differently from conversation.createdAt and conversation message.sent.
Expected behavior
No response
Steps to reproduce the bug
No response
The text was updated successfully, but these errors were encountered:
Describe the bug
On iOS group createdAt (which is supposed to be unix timestamp or milliseconds since 1970) always ends in three 0s on iOS. The same can be seen for the sent field on group messages which should also be the millisecond unix timestamp.
An example from the log would be, Android logging:
LOG Group createdAt: 1708614527922
LOG Conversation createdAt: 1708614528344
LOG Group message sent: 1708614547377
LOG Conversation message sent: 1708614547353
while iOS would log:
LOG Group createdAt: 1708614407000
LOG Conversation createdAt: 1708614407244
LOG Group message sent: 1708614407000
LOG Conversation message sent: 1708614407820
I also added the following tests in a draft PR which pass on RN Android but fail on RN iOS (just the group assertions fail) - https://github.com/xmtp/xmtp-react-native/pull/281/files#diff-4b96887b4344b96a5d9e30cad1e87d74d6d9eab735f00c9c0cbad5e976f1ccb4
This would mess up the order of things in automated tests, and when streaming messages quickly.
This is strange because the code looks like it should break for Conversations and Groups, but somehow the precision looks fine for Conversations. Relevant code for taking timestamps from the xmtp-ios SDK and converting them into a JSON object that is imported into React Native typescript can be seen below:
GroupWrapper.swift - https://github.com/xmtp/xmtp-react-native/blob/beta/ios/Wrappers/GroupWrapper.swift#L23
ConversationWrapper.swift - https://github.com/xmtp/xmtp-react-native/blob/beta/ios/Wrappers/ConversationWrapper.swift#L23
DecodedMessageWrapper.swift - https://github.com/xmtp/xmtp-react-native/blob/beta/ios/Wrappers/DecodedMessageWrapper.swift#L14
Notice they all use a similar syntax UInt64(conversation.createdAt.timeIntervalSince1970 * 1000) vs UInt64(group.createdAt.timeIntervalSince1970 * 1000),
So I belive the question should be where in xmtp-ios are the group.createdAt and message.sent fields being handled differently from conversation.createdAt and conversation message.sent.
Expected behavior
No response
Steps to reproduce the bug
No response
The text was updated successfully, but these errors were encountered: