hk21702 / YA-GCal-Notion-Sync-Script

Script to synchronize between a Notion database and Google Calendar both ways. Uses Google App Script.
GNU General Public License v3.0
139 stars 10 forks source link

Repeating events #66

Closed julia562 closed 8 months ago

julia562 commented 9 months ago

Make Sure You Are On The Latest Main Branch Version Before Reporting A Bug!!!

Include the following information: I tried to find this but cannot haha — just started using this yesterday.

Describe the bug I moved a repeating event in GCal, and the script didn't limit the repeating events into the future like it had done on the full sync, resulting in my being rate limited in Google Scripts. I at first noticed that in the code, RELATIVE_MAX_DAY seemingly only applies when running a full sync and not for new events, though I later realized I had misread that. I'm having trouble parsing exactly where it applies in the code. After this, I attempted a full sync, thinking that this would resolve the problem. However, this again resulted in hitting the rate limit after reaching 2071 in my monthly repeating event.

Screenshots

Screenshot 2023-12-10 at 10 01 54 AM

Additional context

hk21702 commented 9 months ago

So changing RELATIVE_MAX_DAY only works for full sync because it is a parameter that can't be changed in Google's API after the first sync is generated. My understanding of how the API works is that once you set it the first time you call it, in subsequent calls using subsequent sync tokens, the API will use the max day parameter from the time you first generated that series of sync tokens.

The consequence is that whenever you want to change RELATIVE_MAX_DAY, you need to do a full sync for it to apply.

Now 2071 is way past the default 5 years that RELATIVE_MAX_DAY is supposed to allow the API to call so behavior is really strange. The actual parameter that is passed to the API is a date, where the relative max day global variable is turned into a date based on the date of you running the script. It could be that function is broken, there being some weird behavior with repeating events, Google changing the API behavior, or me misunderstanding how that API function worked when I first implemented it. If you can, please provide me with more info.

Action Items for you:

  1. What is RELATIVE_MAX_DAY set to in the main file? It should be an integer.
  2. What is the commit ID for the main file that you are using? That or the date of the commit that you are using. It should be in the top right corner of the page with the code. The commit ID is a sting of letters and numbers, something like 08f9caa
github-actions[bot] commented 8 months ago

This issue has not had any activity for an extended period of time and is thus automatically being marked as stale.

Author, you can help out by closing this issue if the problem no longer exists, or adding more information.

github-actions[bot] commented 8 months ago

This issue has been closed automatically because it needs more information and has not had recent activity.

StroescuDiana commented 3 months ago

@hk21702 I have the same issue and I posted a bug report too. The relative max day for me it's set to 1825

Screenshot 2024-05-28 at 19 57 48