Conversation object does not return action messages in the last message property

When fetching conversations using ConversationRequest, Action Messages are not being returned as the last message property if the Action Message is not owned by the current user.

Steps to reproduce:

  1. Login as superhero1.
  2. Create a group and add participants (superhero2, superhero3).
  3. Execute a group action like kick participant superhero2.
  4. Fetch the conversations and you will see that the last message set for the group is “superhero1 kicked superhero2”.
  5. Login on another device using superhero3.
  6. Fetch conversations. Conversation object for that group chat will return nil last message, expected value on the should be the last action message which is superhero1 kicked superhero2.

Hi @jeraldo, we have checked this issue however we are unable to encounter it in SDK. But if you are checking the same in Sample Apps then yes there is a condition added in conversations for actionMessages. You need to remove the condition if conversation.conversationType == .user present in cellforrowatindexPath and then try running the sample app. We will update the sample apps with this change. Let us know if you face any other issue.

1 Like

Thanks Jeet. I currently have no conditions for the conversations. Please see the following response from the CometChat API for the following scenario. Also please notice that the updatedAt is not returned on Conversation without last message.

Hi @jeraldo,

This issue appears to be fixed.

The conversation list of superhero3 shows superhero1 kicked superhero2.

1 Like

Hi @ketan.yekale @nishant.tiwari the above scenario seems to be fixed. However, an issue related to this one also exist. When you create a group and add participants. Once the group is created and the conversation object for that group on the participants side are returning nil on lastMessage and 0.0 on updatedAt. The lastMessage should be like “Group creator added participant1” in the Conversations object. This is the case when loading the messages in the MessageRequest but not in the ConversationsRequest.

Hi @jeraldo,

Thank you for reporting this issue. It has been fixed at REST API server.

You can add a new member to a group and login as a new member to see the new conversation for the group with last message indicating “someone added new member”.

Warm Regards,

Ketan Yekale
CometChat Team

2 Likes