YA-GCal-Notion-Sync-Script icon indicating copy to clipboard operation
YA-GCal-Notion-Sync-Script copied to clipboard

Cannot add new calendar IDs without the process failing ("API call to calendar.events.list failed with error: Sync token is no longer valid, a full sync is required.")

Open Etheride opened this issue 1 year ago • 5 comments

Hello!

I would like to use this script to sync between Notion and GCal however there are issues when I try to add a new calendar ID to CalendarID.js such as the script fails to execute once I add a new Calendar ID as the error "10:13:20 AM Error Error: API call to calendar.events.list failed with error: Sync token is no longer valid, a full sync is required.". I do not know how to patch this as I am not profficient in JS.

Would it be possible for you to add me on discord as I would like help with another issue :P ether#9925

The Stack Trace is

Error: API call to calendar.events.list failed with error: Sync token is no longer valid, a full sync is required.
syncFromGCal	@ main.gs:143
main	@ main.gs:30

The calendar ID constants is below

  /* Add calendars here. 
  The key (string before ':') is what you name the calendar. 
  The value (string after ':') is the calendar ID. 
  E.g. "My calendar name"]: "mycalendarid", */
  ["Primary"]: "primary",
  ["Birthdays"]: "addressbook#[email protected]",
};

Etheride avatar Aug 23 '22 09:08 Etheride

I was able to replicate this issue. The birthday calendar you're using seems to be one of the autogenerated ones made by Google. I'll look into how to handle it later when I can, but from initial testing it seems like for some reason these kinds of calendars are treated differently by the Google Calendar API.

hk21702 avatar Aug 23 '22 09:08 hk21702

The same thing occurs with Google Classroom's calendar as well

Etheride avatar Aug 23 '22 09:08 Etheride

Yea, it seems like any of the auto generated calendars such as birthdays or public holidays won't work. It's not even the fact that the calendar is read only since the call fail is just at trying to list all the events in the calendar. This might be a limitation of the API itself to be honest unfortunately. I'm not sure about the case for Google Classroom's calendar. That may also count as an auto generated calendar, but I haven't checked for myself.

hk21702 avatar Aug 23 '22 09:08 hk21702