sp-dev-fx-webparts
sp-dev-fx-webparts copied to clipboard
React-Graph-Calendar Code 429 - Too Many Requests when trying to load on page
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
- Deploy the 1.2.3.0 package
- Add webpart to a Team site (with a group)
- Add web part to a page
- Create events to show on the page
- Navigate to the page
- 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
Thank you for reporting this issue. We will be triaging your incoming issue as soon as possible.
Hi @elpinto007,
Out of curiosity, how many events (in total) do you have?
I think this is a throttling issue
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!
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.
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.