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

another error 400 #49

Closed emisaghi closed 1 year ago

emisaghi commented 1 year ago

Thanks for the amazing project! I'm getting the following error when I'm doing a full initialization. Any help would be appreciated!

Error: {"object":"error","status":400,"code":"validation_error","message":"body failed validation: body.properties.Description.rich_text[0].text.content.length should be ≤ 2000, instead was 2724."}

emisaghi commented 1 year ago

I just did some more research and it sounds like Notion limits each block to 2000 characters. I might have some calendar items with descriptions larger than 2000 characters (full zoom invite descriptions could be one). I wonder if there is a way to avoid this issue without cutting the descriptions in my Google Calendar (since this is a two-way integration).

hk21702 commented 1 year ago

I'll add an update that allows you have a setting ignore events that are incompatible with either Notion or GCal. There isn't really an elegant way to handle this other than just straight up ignoring the events in my opinion because the script can't be sure how to best modify something so that they are compatible, and any modifications it does will be propagated to both Notion and GCal in a way that people may dislike.

emisaghi commented 1 year ago

I agree. I think that's the best way to deal with those events. Thank you!

hk21702 commented 1 year ago

Just merged something that should partially solve the issue onto main. Note that this specific issue will only fail gracefully if it is a new event never seen before in Notion.

If the event was updated from the GCal side to have too large of a description but the event already existed in a previous form on Notion, then it will still fail catastrophically though this is intentional to try and prevent some funny business with the data happening during sync.