You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
The script generates duplicate events on start date for fetching Toggl entries. For each execution the script doesn't recognize the fact that on a previous execution it had already created an event starting a year ago. If I change start date (I set a week ago for example) I get the same bug and I have duplicate events a week ago.
At the moment I can't seem to understand why this happens, so I just wanted to let you know!
The text was updated successfully, but these errors were encountered:
I had the same thing happening with me too. I suspect its because of GCal and Toggl sending different number of events for the same time. I have explained more of that stuff in my Pull request reply #1
So in my modification, I have set GCal to retrieve events 2 days prior to current time, and Toggl entries 1 day prior to current time. This has fixed the issue for me
Quote from my reply:
When getting all events from Toggl, instead of fetching it from last year, I've made it to fetch it from 1 day ago.
1 day seems a reasonable time range to me instead of 1 year. less execution time, less headache 😅
Similarly for fetching GCal events, I've fetched events from 2 days ago instead of 1.
When fetching events from 1 day, the thing that happened was, for the same time range Toggl was sending all events from 12am of the previous day to the current time (say for example, 27 entries).
But, GCal was sending events within 24hr time range instead of events from 12am of the starting of the previous day (GCal sent, 21 events for the same time range)
So to fix that, GCal now fetches events from 2 days prior to the current day, so now we have more GCal events than Toggl entries.
This prevents duplicating of events which was happening with me when I made this change later on in the day.
Your Logging code (Toggl entries length, GCal events length) helped me figure out why script was duplicating events in Calendar
The script generates duplicate events on start date for fetching Toggl entries. For each execution the script doesn't recognize the fact that on a previous execution it had already created an event starting a year ago. If I change start date (I set a week ago for example) I get the same bug and I have duplicate events a week ago.
At the moment I can't seem to understand why this happens, so I just wanted to let you know!
The text was updated successfully, but these errors were encountered: