xmtp / xmtp-react-native

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

Bug: Streaming all group messages causes no streamGroup callbacks #415

Closed alexrisch closed 3 months ago

alexrisch commented 3 months ago

Describe the bug

Streaming all group messages causes no streamGroup callbacks

 const [alix, bo] = await createClients(2)
  console.log('created clients')

  let groupCallbacks = 0
  let messageCallbacks = 0
  await bo.conversations.streamGroups(async () => {
    console.log('message received')
    groupCallbacks++
  })

  await bo.conversations.streamAllMessages(async () => {
    console.log('message received')
    messageCallbacks++
  }, true)

  const group = await alix.conversations.newGroup([bo.address])
  await group.send('hello')

  await delayToPropogate()
  await new Promise((resolve) => setTimeout(resolve, 10000))
  assert(groupCallbacks === 1, 'group stream should have received 1 group') // <--- Fails here
  assert(
    messageCallbacks === 1,
    'message stream should have received 1 message'
  )
  return true

Expected behavior

No response

Steps to reproduce the bug

No response