My app has profile pages for the users and on that page is a button that allows you to message that particular user inside the app. The current workflow is “create a new conversation” and that works fine. My issue is that if either of the users in the conversation navigate back to either ones profile page and clicks the “send message” button, bubble creates a new conversation between those same two users. This in turn, creates multiple conversations between the same two people inside the “inbox” section of each users profile. Id rather have bubble recognize that a conversation already exists between the two users and send the new message to that instead of creating a whole new conversation. Any help is appreciated
you should probably change your database structure a little bit.
I’d recommend having two data types for this: Thread and Message.
Thread has a field called Users which is a list of Users.
Message (apart from standard fields like message content, attachment etc.) has a field called Thread that references a thread that the message belongs to.
When creating a message, you do a search for a thread that contains both users (and if it doesn’t exist yet, you create a new Thread at that moment) and you set the thread field to that thread.
If you want to display all of the messages between users, you search for all the messages that reference a thread that contains both of the users.
Hope that helps,
Hello Austin & Alan,
I have the same issue, easy to create a new conversation, but not to refer to an existing conversation.
I have 2 data types: converations (with a list of users and a list of messages) and messages.
Not sure how to create a New conversation Only when the current user and the Parent user hasn’t already a conversation