xmtp / xmtp-react-native

A package you can use to build with XMTP in a React Native or Expo app.
MIT License
35 stars 14 forks source link

Bug: Message.sent returns current time after syncing group #394

Closed alexrisch closed 1 month ago

alexrisch commented 1 month ago

Describe the bug

This test case fails

  const [alix, bo] = await createClients(2)
  const alixGroup = await alix.conversations.newGroup([bo.address])
  await alixGroup.send('Hello')
  const messages1 = await alixGroup.messages()
  const message1 = messages1[0]
  await alixGroup.sync()
  const messages2 = await alixGroup.messages()
  const message2 = messages2[0]
  assert(message1.id === message2.id, 'Message id should be the same')
  assert(message1.sent === message2.sent, 'Message sent should be the same') // <--- Fails here

This happens for both iOS & Android

Expected behavior

Message.sent should reflect when the message was sent, not when the message was synced/ loaded

Steps to reproduce the bug

No response