How to prevent thread.replies from triggering if a sender responds to it's own thread?

I am transitionning to Nylas V3.

In my V2 implemention of the thread.replied webhook, I had to check if the reply was triggered by the sneder or by the recipient doing this:

        $data = json_decode($request->getContent());
        $deltas = $data->deltas[0];
        $threadId = $deltas->object_data->metadata->thread_id;
        $logger->warning('We received a response for Thread ID: ' . $threadId);

        // from_self value will be set to true when a user replies to their own thread.
        //Therefore not accounted as an answer
        if ($deltas->object_data->metadata->from_self || $deltas->object_data->metadata->from_self == "true") {
            $logger->warning('Thread ID: ' . $threadId . ' was not paused because it was responded from it\'s on sender.');
            return new JsonResponse(null, 200);
        }

I cannot find a from_self field in the thread.replied webhook response, What should I do about that?

Many thanks

Hello @Yohann Let me ask and will come back to you :slight_smile:

1 Like

Hello, any news on this?

Thank you

Should I ask Customer service directly?

Hello @Yohann sorry for the wait, the platform team is looking at this, but they’re busy with other things as well :frowning: so it might take them so time…will keep you updated :pray:

@Yohann There’s a ticket already assigned for this :wink: So it will be taken care of pretty soon :slight_smile:

It is unfortunate to observe that after almost 2 weeks I still can’t get a response. Nylas forced us to transition from V2 to V3 when its value prop was to help us save time with development. You should have come up with a team of engineers that help your clients smoothen this transition.

@Yohann I gave you a response, which is that there is a ticket and it’s been taking care of. I know not at the speed that you need, but it will be fixed for sure. Sorry about any delays or problems found :frowning:

Hello @Yohann It looks that in the end the field was there all along data.object.from_self

Here’s an example:

{
  "specversion": "1.0",
  "type": "thread.replied",
  "source": "/com/nylas/tracking",
  "id": "E98E6YXGNh2BdMCtXuSYBK6452",
  "time": 1726156452,
  "webhook_delivery_attempt": 1,
  "data": {
    "application_id": "df7063a3-dcf4-42f8-b0a0-bcc4e691d343",
    "grant_id": "f1aeed82-fb33-42df-b2e2-2587bebcf5b9",
    "object": {
      "from_self": false,
      "grant_id": "f1aeed82-fb33-42df-b2e2-2587bebcf5b9",
      "label": "hey just testing",
      "message_id": "AQMkADAwATM3ZmYAZS00ODRlLTQ3OGEtMDACLTAwCgBGAAADECJk0vdr3EuPmBaEao538wcAYZA60EsW806zQVDI4CY_qAAAAgEMAAAAYZA60EsW806zQVDI4CY_qAACd7KjdgAAAA==",
      "object": "thread",
      "reply_data": {
        "count": 3
      },
      "reply_to_message_id": "",
      "root_message_id": "AAkALgAAAAAAHYQDEapmEc2byACqAC-EWg0AYZA60EsW806zQVDI4CY_qAACd7KvTAAA",
      "sender_app_id": "df7063a3-dcf4-42f8-b0a0-bcc4e691d343",
      "thread_id": "AQQkADAwATM3ZmYAZS00ODRlLTQ3OGEtMDACLTAwCgAQAGQzVNR2tTRGi2Uxw92pnfQ=",
      "timestamp": 1726156452
    }
  }
}

Hello Thank you Blag. Are you sure this is for the API v3?

This is different from the documentation: Notification schemas | Nylas Docs

this is what they give in the doc:

{
  "specversion": "1.0",
  "type": "thread.replied",
  "source": "/com/nylas/tracking",
  "id": "d67b0806-b263-4fca-b297-c62478a66e01",
  "time": 1696007157,
  "data": {
    "application_id": "NYLAS_APPLICATION_ID",
    "grant_id": "NYLAS_GRANT_ID",
    "object": {
      "message_id": "<message-id-of-reply>",
      "root_message_id": "<message-id-of-original-tracked-message>",
      "label": "some-client-label",
      "reply_data": {
        "count": 1
      },
      "sender_app_id": "<app-id>",
      "thread_id": "<thread-id-of-sent-message>",
      "timestamp": 1696007157
    }
  }
}   

So it’s a bit confusing, can you please double check with the engineers ?

Many thanks

Hello @Yohann you’re right :thinking: I just test this on Pipedream and couldn’t found the field either :pensive: I have updated the ticket to engineering asking for clarification…will keep you posted…

Thank you. I would appreciate if we could put this to urgent. It’s been 18 days since my initial ticket …

Hello @Blag I’m in process of migrating to v3 too and this issue is blocking me too. Is there a way to track the ticket you opened?

@Yohann @jose This is what I get back from engineering…

I will ask Docs to update their sample…

Great thank you for your assistance