diff --git a/packages/common/services/conversationService.ts b/packages/common/services/conversationService.ts index e05859c..9426bc4 100644 --- a/packages/common/services/conversationService.ts +++ b/packages/common/services/conversationService.ts @@ -129,6 +129,13 @@ export default class ConversationService { ); const conversationDoc = doc(this.db, Collections.conversations, convoId); + const userConvoAssocDoc = doc( + this.db, + Collections.conversations, + convoId, + Collections.conversationMembers, + createdByUserId + ); await runTransaction(this.db, async (transaction) => { // want to add to the long term collection of all audio clips for a conversation @@ -148,6 +155,15 @@ export default class ConversationService { }, { merge: true } ); + + // update the user's convo assoc so that their last interaction was set properly + transaction.set( + userConvoAssocDoc, + { + lastInteractionDate: serverTimestamp(), + }, + { merge: true } + ); }); } }