The issue that I am experiencing is when trying to remove a user from a conversation for the second time.
When a user is re-added a new participant document is created and linked up with the conversation. Then when the same user is removed from the conversation for the second time conversation.removeParticipant isn't setting the deleted field on the correct participant document (it is actually setting it on the initial document that has already been flagged as deleted).
I could help fix this issue but how should this workflow be handled?
- Should conversation.addParticipant never create a new participant for the same user-conversation pairing and update the existing participant document?
- Or should conversation.removeParticipant be fixed so the query is finding the document that does not have the deleted flag set yet?