429 throttling even though I wait for each request to complete

Iron Contributor

 

I am using the Graph API in SPFx (MSGraphClient).

 

I need to add events to a user calendar (usually between 10 and 20 for the month). Unfortunately, the throttling limit for events is only 4 (!).

 

To try and prevent concurrent events, I am executing the requests one at a time, with an await expression:

              for (let i = 0i < locks.lengthi++) {
                let lock = locks[i];
                await props.context.msGraphClientFactory.getClient()
                  .then((clientMSGraphClient:( void => {
                    client
                      .api("/me/events")
                      .post({
                        "subject":...
 
This doesn't work, I am still getting 429 throttling message even though the requests are not concurrent. What am I missing here, and what would be the proper way to handle the situation?
2 Replies

I have created a SPFx package that reproduces the issue:
https://github.com/PathToSharePoint/Outlook-Throttling

Note that it requires Graph API permissions.

Hi Christophe - The SPFx team actively monitors this Github repo for questions, so I suggest posting your inquiry there: https://github.com/SharePoint/sp-dev-docs