|
|
@@ -316,11 +316,7 @@ async function processMessage(msg: Message) {
|
|
|
// --- 3. Prepare User Data for MongoDB Batch Update ---
|
|
|
// userSetData will contain fields to be updated using $set for both new and existing documents.
|
|
|
// 'project' is now excluded here as it will be handled by $setOnInsert only.
|
|
|
- // const userSetData: Partial<IUser> = { lastActiveAt: lastActiveAtDateObj };
|
|
|
- const userSetData: Partial<IUser> = {};
|
|
|
- if (eventType !== "message_receive") {
|
|
|
- userSetData.lastActiveAt = lastActiveAtDateObj;
|
|
|
- }
|
|
|
+ const userSetData: Partial<IUser> = { lastActiveAt: lastActiveAtDateObj };
|
|
|
|
|
|
// SetOnInsert fields will only apply when a new document is created
|
|
|
const setOnInsertFields: any = {
|