You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
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?
The text was updated successfully, but these errors were encountered:
I've come across another spot that needs a similar fix to this issue.
There is a side-effect that is triggered from MessagesCollection.after.insert.
If a user has been re-added to a conversation and the other user creates a new message, they are removed from the conversations due to the MessagesCollection.after.insert. This hook updates the 'deleted' participant is with read set to false. This update then triggers the ParticipantsCollection.after.update hook to remove the participant from the conversation.
To fix this, the ParticipantsCollection.update query needs to target participants that are not marked as deleted. I can add this fix to #42.
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?
The text was updated successfully, but these errors were encountered: