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

iCal Provider rejects request resulting in deletion of all calendar events #312

Closed
babyarms opened this issue Jan 30, 2023 · 3 comments
Closed
Labels
bug Something isn't working

Comments

@babyarms
Copy link

It's not stated by the provider, but if they receive too many requests, they deny us from pulling from the iCal. The times are inconsistent, they can work within 5-minute sync times, or 1 hour sync times can cause an issue result in HTTP error 429. Is there a way to adjust the code to do a try/catch or completely quit upon URL response equaling to 429 to prevent deletion?

Currently, if we receive the HTTP 429 error, all events existing in the calendar are deleted. The next time it syncs, it creates new events, but becomes an endless loop. I was going through some other issues and someone else had a similar problem but didn't seem to be a solution. I'm only using one calendar and one iCal if that is relevant.

@babyarms babyarms added the bug Something isn't working label Jan 30, 2023
@jonas0b1011001
Copy link
Collaborator

You can stop the execution and prevent removal of the events by adding

if (responses.length == 0)
      return;

above code.gs L160

@derekantrican
Copy link
Owner

@babyarms - did you try out @jonas0b1011001 's suggestion?

@derekantrican
Copy link
Owner

Closing as there has been no response. Please comment again if this is still an issue

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
bug Something isn't working
Projects
None yet
Development

No branches or pull requests

3 participants