I noticed that sometimes when I added somebody to a chat, their name would be printed twice in the robotext and the notif.
I investigated and found that it was because we're determining addedMemberIDs incorrectly in this code, as we're including any rows in the changeset for any threads. It's possible for adding somebody to a thread to cause their membership row to change for another thread, eg. a subthread they are already in.
To avoid this we could also check intent, but I figured checking threadID was more appropriate.