Conversation id changes after editing subject?

Anonymous
2023-03-29T14:02:00.32+00:00

In our application we create a conversation based on the conversation_id returned by the MS Graph api's.

This works fine, but when someone changes the subject, the conversation id is also changed.

Happy flow:

  1. Receive mail -> conversation_id = 1
  2. Send reply (can't add the conversation_id, register the id in my application)
  3. Receive a reply on step 2 -> conversation_id = 1

Now I can make a conversation of stap 1, 2 and 3, based on conversation_id = 1

Sad flow

  1. Receive mail -> conversation_id = 1
  2. Send reply (can't add the conversation_id, register the id in my application)
  3. Receive a reply on step 2 where the subject is changed -> conversation_id = 2

Now I cant't make a conversation because changin the subject also changed the conversation_id in stap 3

For the receive we use

Is it posible to create a conversation in the "sad flow" based on the data MS graph returns?

Microsoft Security | Microsoft Graph
0 comments No comments
{count} votes

Accepted answer
  1. Glen Scales 4,446 Reputation points
    2023-03-29T23:50:18.67+00:00

    The ConversationId is computed from a bunch of underlying message properties https://learn.microsoft.com/en-us/openspecs/exchange_server_protocols/ms-oxomsg/f8e4a5fa-cb73-4eca-b174-72e1fda821a6 so changing the subject would also modify the Conversation Topic https://learn.microsoft.com/en-us/office/client-developer/outlook/mapi/pidtagconversationtopic-canonical-property so a different ConversationId expected. This behavouir is documented for EWS but work the same for Graph https://learn.microsoft.com/en-us/exchange/client-developer/exchange-web-services/how-to-work-with-conversations-by-using-ews-in-exchange

    Exchange applies the same ConversationTopic value to replies to the first message and then updates the ConversationIndex value to represent the message's position relative to the original message. If the subject of the email thread changes, Exchange applies a new ConversationTopic value and new ConversationIndex values to the new conversation.

    You can track if a message is a reply to another message using the in-Reply-to property https://learn.microsoft.com/en-us/office/client-developer/outlook/mapi/pidtaginreplytoid-canonical-property eg

    $expand=singleValueExtendedProperties($filter=id eq 'String 0x1042')
    
    0 comments No comments

2 additional answers

Sort by: Most helpful
  1. Anonymous
    2023-03-30T08:05:03+00:00

    Thanks Glen for the great explanation!

    Now I am trying to use the "in-reply-to" property, but i'm not quite sure how to use this.

    For example:

    • Is it possible to add it in the get me message call?
    • I tried the example below
    GET 
    https://graph.microsoft.com/v1.0/me/messages$expand=singleValueExtendedProperties($filter=id eq 'String 0x1042')
    
    

    The result is:

    {
    	"error": {
    		"code": "BadRequest",
    		"message": "Open navigation properties are not supported on OpenTypes. Property name: 'messages$expand=singleValueExtendedProperties'.",
    		"innerError": {
    			"date": "2023-03-30T06:34:46",
    			"request-id": "e7aa8146-f5f1-4311-9f1b-07657e0dfdc9",
    			"client-request-id": "e7aa8146-f5f1-4311-9f1b-07657e0dfdc9"
    		}
    	}
    }
    

  2. Anonymous
    2023-04-03T13:24:54.9133333+00:00

    Thanks, that did the trick.

    Is it possible to do a top 50 call and use singleValueExtendedProperties in one call?

    https://graph.microsoft.com/v1.0/users/{user id}/mailfolders/{folder_id}/messages?$expand=singleValueExtendedProperties($filter=id eq 'String 0x1042')$top=50

    When I try this, I tells: Parsing OData Select and Expand failed: Term 'singleValueExtendedProperties($filter=id eq 'String 0x1042')$top=50' is not valid in a $select or $expand expression


Your answer

Answers can be marked as Accepted Answers by the question author, which helps users to know the answer solved the author's problem.