Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Multiple Notifications sent When Graph API SDK Patch Sent #1996

Closed
noelrfMcM opened this issue Jul 3, 2023 · 6 comments
Closed

Multiple Notifications sent When Graph API SDK Patch Sent #1996

noelrfMcM opened this issue Jul 3, 2023 · 6 comments

Comments

@noelrfMcM
Copy link

Describe the bug
currently using Microsoft Graph v 5.3.0. I have a web service written in .net core 6.0
to update Events in outlook by adding an attendee or removing it as required. I am also forwarding events to other emails.
The attendee is a room location resource email which is set to auto accept if free and auto decline if busy.

The trigger is a room booking system database change so we know the attendee to add then run the code.

The code is very much as per Microsoft example:

var graphClient = initialiseGraphClient(tenantId, clientId, secretName, keyVaultName, keyVaultURL);

            var requestBody = new Event
            {
                Recurrence = null,
                Attendees = attendees,
                Location = location,
                Locations = locations
            };

            var resultEvent = await graphClient
               .Users[userEmail]
               .Events[eventId]
               .PatchAsync(requestBody);

When I do a patch to update the attendee list (remove or add an attendee), notifications are not only sent to the host but also
all the attendees. In some cases this can be 3 notifications at once with the same status of the new attendee has accepted.

To Reproduce
Steps to reproduce the behavior:

  1. Create room booking, change is detected in the database by the web service
  2. Run the code as shown adding in the attendees plus the new attendee.
  3. wait in outlook for notifications which appear.

Expected behavior
Only one notification should be sent.

Screenshots
If applicable, add screenshots to help explain your problem.

Server:

  • OS: Web service sits on a windows 2012 server
@ghost ghost added the Needs: Triage label Jul 3, 2023
@andrueastman
Copy link
Member

Thanks for raising this @noelrfMcM

According to the documentation, you want only to have the attendees property in the request payload for this to work as you wish. https://learn.microsoft.com/en-us/graph/api/event-update?view=graph-rest-1.0&tabs=http#notes-for-updating-specific-properties

Any chance you get a different result if you set the body as below to only update the specfied property?

var requestBody = new Event
{
    Attendees = attendees
};

@noelrfMcM
Copy link
Author

noelrfMcM commented Jul 6, 2023 via email

@ghost
Copy link

ghost commented Jul 10, 2023

This issue has been automatically marked as stale because it has been marked as requiring author feedback but has not had any activity for 4 days. It will be closed if no further activity occurs within 3 days of this comment.

@microsoft-github-policy-service
Copy link
Contributor

This issue has been automatically marked as stale because it has been marked as requiring author feedback but has not had any activity for 4 days. It will be closed if no further activity occurs within 3 days of this comment.

1 similar comment
@microsoft-github-policy-service
Copy link
Contributor

This issue has been automatically marked as stale because it has been marked as requiring author feedback but has not had any activity for 4 days. It will be closed if no further activity occurs within 3 days of this comment.

@ssougnez
Copy link

Thanks for raising this @noelrfMcM

According to the documentation, you want only to have the attendees property in the request payload for this to work as you wish. https://learn.microsoft.com/en-us/graph/api/event-update?view=graph-rest-1.0&tabs=http#notes-for-updating-specific-properties

Any chance you get a different result if you set the body as below to only update the specfied property?

var requestBody = new Event
{
    Attendees = attendees
};

I had the same issue and I can confirm that this works.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Projects
None yet
Development

No branches or pull requests

3 participants