ConnectyCube / connectycube-reactnative-samples

Chat and Video Chat code samples for React Native, ConnectyCube
https://connectycube.com
Apache License 2.0
124 stars 111 forks source link

Cannot send messages in groups #232

Closed dozsolti closed 3 years ago

dozsolti commented 3 years ago

Hi,

I am working on an app which already has dialogs between 2 users and works just fine. Now when I tried to integrated groups chats the messages aren't sending.

No errors, no warnings, nothing when I call the send function, but also nothing when I check in the dashboard the group or when I retrieve the dialog by id.

This is my send function, the property names are a bit different, because I have custom classes (ex. from dialog._id -> dialog.id). But the values are correct.

async Send(dialog, message, connectyCubeUser, attachmentID = null) {
    const body = message.trim()
    const sentDate = Math.floor(Date.now() / 1000)

    const targetID = dialog.isGroup ? dialog.id : dialog.occupants_ids.find(
        elem => elem !== connectyCubeUser.id
    )

    let msg = {
        id: null,
        type: dialog.xmpp_type,
        body,
        extension: {
            save_to_history: 1,
            dialog_id: dialog.id,
            sender_id: connectyCubeUser.id,
            date_sent: sentDate,
            ...(attachmentID ? { attachmentID } : {}),
        },
        markable: 1,
    }

    msg.id = await ConnectyCube.chat.send(targetID, msg)
    return msg
}

Also I tried with the latest version (v3.9.1) (first tried with v3.7.8) but nothing

DaveLomber commented 3 years ago

@dozsolti please console log the 'msg' and 'targetID' vars

Also, please enable logs like here https://developers.connectycube.com/js/?id=configuration and post the logs when you send a message

dozsolti commented 3 years ago

image

DaveLomber commented 3 years ago

@dozsolti ok this is fine

then please share the logs

dozsolti commented 3 years ago

image

DaveLomber commented 3 years ago

@dozsolti so it says no such room

please show how you create a room before sending a message

dozsolti commented 3 years ago

I've used the new dialog popup from the dashboard, entered some name and the occupants ids and that's it

dozsolti commented 3 years ago

@dozsolti so it says no such room

please show how you create a room before sending a message

It was created successfully and it exists in the dashboard image

dozsolti commented 3 years ago

Updates: This wasn't working in any groups, but started working in some... The one I send it still doesn't work. One key difference is that looks like if was created through API it works, but from dashboard no

DaveLomber commented 3 years ago

@dozsolti could you try top create a new dialog via Dashboard and let us know how it works with it?

dozsolti commented 3 years ago

@DaveLomber Ok it worked, I created a new one from Dashboard and I've was able to send a message.

The old group is working the same

DaveLomber commented 3 years ago

@dozsolti ok great

if you to fix any old chats, just send here a list of iDs

dozsolti commented 3 years ago

It's alright, it was only for testing purposes.

I just wonder what happend to it, so I can omit it in the future

DaveLomber commented 3 years ago

@dozsolti There was a maintenance window yesterday, probably you just created some dialogs during it so it leaded to this behaviour

dozsolti commented 3 years ago

Alright, thank you for help