sp-dev-fx-webparts icon indicating copy to clipboard operation
sp-dev-fx-webparts copied to clipboard

React-Graph-Calendar Code 429 - Too Many Requests when trying to load on page

Open elpinto007 opened this issue 3 years ago • 5 comments

Sample

https://github.com/pnp/sp-dev-fx-webparts/tree/main/samples/react-graph-calendar

Author(s)

@sebastienlevert

What happened?

After successfully deploying the latest version (1.2.3.0), some users started noticing the events sporadically dont show up on the calendar. The following error is shown on the dev tools:

VM175154:1 GET https://graph.microsoft.com/v1.0/groups/<group-id>/events/.../instances?startDateTime=2021-05-30T07:00:00.000Z&endDateTime=2021-07-11T07:00:00.000Z&$select=subject,start,end,location,bodyPreview,isAllDay,type 429 (Too Many Requests)

Some users have reported this happening the first time when they load the page, and when we hit refresh as well.

Steps to reproduce

  1. Deploy the 1.2.3.0 package
  2. Add webpart to a Team site (with a group)
  3. Add web part to a page
  4. Create events to show on the page
  5. Navigate to the page
  6. Click refresh

Expected behavior

The expected behavior is for the calendar event to load up every time.

Target SharePoint environment

SharePoint Online

Developer environment

No response

Browsers

  • [ ] Internet Explorer
  • [X] Microsoft Edge
  • [X] Google Chrome
  • [ ] FireFox
  • [ ] Safari
  • [ ] mobile (iOS/iPadOS)
  • [ ] mobile (Android)
  • [ ] not applicable
  • [ ] other (enter in the "Additional environment details" area below)

Node.js version

10.13.4

Additional environment details

No response

elpinto007 avatar Jun 24 '21 23:06 elpinto007

Thank you for reporting this issue. We will be triaging your incoming issue as soon as possible.

ghost avatar Jun 24 '21 23:06 ghost

Hi @elpinto007,

Out of curiosity, how many events (in total) do you have?

I think this is a throttling issue

Abderahman88 avatar Jul 01 '21 11:07 Abderahman88

This seems to be a throttling issue indeed. The underlying SPFx version doesn't handle them automatically. I'll try to push a new PR that would fix this issue. Stay tuned!

sebastienlevert avatar Jul 05 '21 19:07 sebastienlevert

Hi @elpinto007,

Out of curiosity, how many events (in total) do you have?

I think this is a throttling issue

One of the groups are using this as a location calendar (ie, who is working from home and who is working from which location). There are about 3-4 events per day. so a total of 60 events per calendar month.

elpinto007 avatar Jul 06 '21 17:07 elpinto007

I identified the issue. It's related to the recurring events and is 100% a throttling issue. Right now, we are emitting all the requests to the event instances at the same time, without throttling management. This means that as soon as we hit a high number of events, it will simply stop working. The next release (which is expected to be very soon) will have that management built-in and you should not see a failing calendar.

sebastienlevert avatar Jul 06 '21 19:07 sebastienlevert