Skip to content

Commit 31fd0e0

Browse files
authored
[FIX] Dedup key in Outlook Shared Email Received causing events to be dropped (#18897)
1 parent c076545 commit 31fd0e0

File tree

2 files changed

+11
-8
lines changed

2 files changed

+11
-8
lines changed

components/microsoft_outlook/package.json

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1,6 +1,6 @@
11
{
22
"name": "@pipedream/microsoft_outlook",
3-
"version": "1.7.3",
3+
"version": "1.7.4",
44
"description": "Pipedream Microsoft Outlook Components",
55
"main": "microsoft_outlook.app.mjs",
66
"keywords": [

components/microsoft_outlook/sources/new-email-in-shared-folder/new-email-in-shared-folder.mjs

Lines changed: 10 additions & 7 deletions
Original file line numberDiff line numberDiff line change
@@ -6,7 +6,7 @@ export default {
66
key: "microsoft_outlook-new-email-in-shared-folder",
77
name: "New Email in Shared Folder Event",
88
description: "Emit new event when an email is received in specified shared folders.",
9-
version: "0.0.3",
9+
version: "0.0.4",
1010
type: "source",
1111
dedupe: "unique",
1212
props: {
@@ -47,8 +47,8 @@ export default {
4747
fn: this.microsoftOutlook.listSharedFolderMessages,
4848
args: {
4949
params: {
50-
$orderBy: "createdDateTime desc",
51-
$filter: `createdDateTime gt ${lastDate}`,
50+
$orderBy: "sentDateTime desc",
51+
$filter: `sentDateTime gt ${lastDate}`,
5252
},
5353
sharedFolderId: this.sharedFolderId,
5454
userId: this.userId,
@@ -61,15 +61,18 @@ export default {
6161
for await (const item of items) {
6262
responseArray.push(item);
6363
}
64-
if (responseArray.length) this._setLastDate(responseArray[0].createdDateTime);
64+
if (responseArray.length) {
65+
this._setLastDate(responseArray[0].sentDateTime);
66+
}
6567

6668
for (const item of responseArray.reverse()) {
69+
const ts = Date.parse(item.sentDateTime);
6770
this.$emit(
6871
item,
6972
{
70-
id: item.conversationId,
71-
summary: `A new email with id: "${item.conversationId}" was received!`,
72-
ts: item.createdDateTime,
73+
id: item.id,
74+
summary: `A new email with subject ${item.subject} was received!`,
75+
ts,
7376
},
7477
);
7578
}

0 commit comments

Comments
 (0)