ConnectyCube / connectycube-flutter-samples

Code samples for Flutter, based on ConnectyCube platform
https://developers.connectycube.com/flutter/
Apache License 2.0
86 stars 90 forks source link

multiple dialogs are getting created for same users in group chat #306

Closed richanshah closed 7 months ago

richanshah commented 10 months ago

i have firstly created dialog with selecting two users. then i come again then i have put check if i found dialog with existing users then it will not create new one but it is creating new dialog as per below so double entryies with same users.

CB-SDK: : User Names: Richie Rich, Richa Shah I/flutter (10395): CB-SDK: : ========================================================= I/flutter (10395): === REQUEST ==== 3b5735b8-ff3e-4626-968b-8d429ffafa41 === I/flutter (10395): REQUEST I/flutter (10395): POST https://api.connectycube.com/chat/Dialog I/flutter (10395): HEADERS I/flutter (10395): {Content-type: application/json, ConnectyCube-REST-API-Version: 0.1.1, CB-SDK: Flutter 2.8.0, CB-Token: 805E104A81B64E86F67440137AC667914CAE} I/flutter (10395): BODY I/flutter (10395): {"photo":"","name":"Richie Rich, Richa Shah","type":2,"occupants_ids":[10909924,0,10909837]} I/flutter (10395): CB-SDK: : *** I/flutter (10395): * RESPONSE 201 3b5735b8-ff3e-4626-968b-8d429ffafa41 *** I/flutter (10395): HEADERS I/flutter (10395): {cb-token-expirationdate: 2023-09-19 08:06:53 UTC, connection: keep-alive, date: Tue, 19 Sep 2023 06:06:53 GMT, strict-transport-security: max-age=15768000; includeSubDomains, content-length: 555, access-control-expose-headers: CB-Token-ExpirationDate, Date, content-type: application/json; charset=utf-8, server: nginx/1.25.0} I/flutter (10395): BODY I/flutter (10395): {"_id":"65093a7dbb652a002f07a9f1","user_id":10909924,"created_at":"2023-09-19T06:06:53Z","updated_at":"2023-09-19T06:06:53Z","name":"Richie Rich, Richa Shah","type":2,"photo":"","occupants_ids":[10909837,10909924],"occupants_count":2,"xmpp_room_jid":"7266_65093a7dbb652a002f07a9f1@muc.chat.connectycube.com","is_e2ee":false,"admins_ids":[],"is_muted":false,"last_message":null,"last_message_date_sent":null,"last_message_id":null,"last_message_user_id":null,"last_message_status":null,"unread_messages_count":0,"pinned_messages_ids":[],"description":null}

I/flutter (10395): CB-SDK: : ========================================================= I/flutter (10395): === REQUEST ==== 9ad9b496-82db-47d5-a7b9-65471efd84f4 === I/flutter (10395): REQUEST I/flutter (10395): POST https://api.connectycube.com/chat/Dialog I/flutter (10395): HEADERS I/flutter (10395): {Content-type: application/json, ConnectyCube-REST-API-Version: 0.1.1, CB-SDK: Flutter 2.8.0, CB-Token: 805E104A81B64E86F67440137AC667914CAE} I/flutter (10395): BODY I/flutter (10395): {"photo":"","name":"Richie Rich, Richa Shah","type":2,"occupants_ids":[10909924,0,10909837]} I/flutter (10395): CB-SDK: : *** I/flutter (10395): * RESPONSE 201 9ad9b496-82db-47d5-a7b9-65471efd84f4 *** I/flutter (10395): HEADERS I/flutter (10395): {cb-token-expirationdate: 2023-09-19 08:07:03 UTC, connection: keep-alive, date: Tue, 19 Sep 2023 06:07:03 GMT, strict-transport-security: max-age=15768000; includeSubDomains, content-length: 555, access-control-expose-headers: CB-Token-ExpirationDate, Date, content-type: application/json; charset=utf-8, server: nginx/1.25.0} I/flutter (10395): BODY I/flutter (10395): {"_id":"65093a87b97c0a002ebfe1bb","user_id":10909924,"created_at":"2023-09-19T06:07:03Z","updated_at":"2023-09-19T06:07:03Z","name":"Richie Rich, Richa Shah","type":2,"photo":"","occupants_ids":[10909837,10909924],"occupants_count":2,"xmpp_room_jid":"7266_65093a87b97c0a002ebfe1bb@muc.chat.connectycube.com","is_e2ee":false,"admins_ids":[],"is_muted":false,"last_message":null,"last_message_date_sent":null,"last_message_id":null,"last_message_user_id":null,"last_message_status":null,"unread_messages_count":0,"pinned_messages_ids":[],"description":null}

richanshah commented 10 months ago

@TatankaConCube please let me know if this is the bug from ur end

richanshah commented 10 months ago

@TatankaConCube do i have to pass my own login id as well in createDialog occoupantids or it is not necessary ?

TatankaConCube commented 10 months ago

please let me know if this is the bug from ur end

no, it is expected behavior when you can create a lot of GROUP chats with the same users.

do i have to pass my own login id as well in createDialog occoupantids or it is not necessary ?

no, the dialog's creator ID will be added automatically to the occupants_ids array

richanshah commented 10 months ago

okay