GAS-ICS-Sync icon indicating copy to clipboard operation
GAS-ICS-Sync copied to clipboard

ICS/ICAL sync duplicating events

Open DamianJLin opened this issue 6 years ago • 28 comments

image

As shown in the screenshot, events are being duplicated. Each event is duplicated exactly twice.

I don't think that this is due to a faulty link because when I let google sync the ICS this does not happen.

DamianJLin avatar Jan 30 '19 06:01 DamianJLin

Damian,

Could you please share with me the script you are using? [email protected]

derekantrican avatar Jan 30 '19 13:01 derekantrican

Derek,

Sorry, but I have deleted the script. I remember that I got it from one of your repositories and only edited the settings, nothing else.

From: Derek Antrican [email protected] Sent: Thursday, 31 January 2019 12:52 AM To: derekantrican/GAS-ICS-Sync [email protected] Cc: DamianJLin [email protected]; Author [email protected] Subject: Re: [derekantrican/GAS-ICS-Sync] ICS/ICAL sync duplicating events (#21)

Damian,

Could you please share with me the script you are using? [email protected] mailto:[email protected]

— You are receiving this because you authored the thread. Reply to this email directly, view it on GitHub https://github.com/derekantrican/GAS-ICS-Sync/issues/21#issuecomment-458950593 , or mute the thread https://github.com/notifications/unsubscribe-auth/Ad9As_vsYJqXKBl9h-uWj2EkrQtRV92Eks5vIaNxgaJpZM4aZg7c . https://github.com/notifications/beacon/Ad9As4cPm2uLFmg9iDc8KZt-piUQbKvEks5vIaNxgaJpZM4aZg7c.gif

DamianJLin avatar Jan 31 '19 06:01 DamianJLin

Ok, well since you don't have a script for me to reference and I haven't been seeing this issue, I'm going to close this issue. If someone else sees the same problem in the future they can report it again

derekantrican avatar Jan 31 '19 06:01 derekantrican

For whatever reason, the script has created duplicates of all my events from only one of the calendars I have inputted. Any suggestions are welcome. Happy to give more specific info if needed.

briankdouglas avatar Apr 01 '20 20:04 briankdouglas

Hi, please check #107 maybe you are facing the same issue.

jonas0b1011001 avatar Apr 01 '20 20:04 jonas0b1011001

So I tried lowering the frequency as suggested (now at 15) and it was working for a few days but no I've got 14 duplicates of all events on only one calendar. Suggestions?

briankdouglas avatar Apr 05 '20 16:04 briankdouglas

@douglasb2021 If you are willing, please share your ICS url with us so we can look into it

derekantrican avatar Apr 05 '20 23:04 derekantrican

@douglasb2021 I just tried syncing a few times and I'm not seeing any duplicated events. Can you check to make sure you have the latest version of the script? At the bottom of Helpers.gs look for a line that says var thisVersion = 5.2;

derekantrican avatar Apr 05 '20 23:04 derekantrican

Yes, it does. However, it typically takes a few days for the duplicate events to be created and once they are there's just more and more of them every day.

briankdouglas avatar Apr 05 '20 23:04 briankdouglas

Once you have duplicates in your target calendar please open the script, run startSync, open view->log and search for an entry like "Fetched XYZ existing events from targetCalendarName", what number does it say there?

jonas0b1011001 avatar Apr 06 '20 10:04 jonas0b1011001

I ran across this duplication issue as well but was able to resolve it. In my case, I believe the issue came from me Installing it but then also manually running it immediately afterwards by doing the startSync. After doing this the first few times, I thought, well what the hell, I'll just install it and let it do it's own thing and now no more duplicate entries!

aznfury avatar Apr 09 '20 19:04 aznfury

@jonas0b1011001 I tried to do that but the logs won't load even if I leave it open for a long time. I just tried what @aznfury suggested and I'll let you know if it happens again (hasn't yet).

briankdouglas avatar Apr 09 '20 21:04 briankdouglas

Thanks for this! I've turned this into a web app to sync with Google Calendar. I've noticed duplicate events like @jonas0b1011001 but they seem to resolve themselves when the script runs again. @derekantrican One question I have is if I modify the Google Calendar event created by this script, for example, add guests, will the event be deleted when it re-syncs because it no longer matches the event coming from the webcal feed? @douglasb2021 looks like your school uses Blackbaud like mine. If your school uses G Suite as well, this web app might interest you. Thanks in advance for your advice.

ande2413 avatar May 15 '20 16:05 ande2413

if I modify the Google Calendar event created by this script, for example, add guests, will the event be deleted

It will not be deleted but overridden with the version from your feed, we are using extendedProperties to match events from your calendar with the ones in the feed, therefore the event will be matched even if you modify it manually.

jonas0b1011001 avatar May 15 '20 17:05 jonas0b1011001

Gotcha, so if I needed that ability, it would be best to trigger startSync(), rather than install() knowing that all future changes would need to be done manually after the initial sync. @derekantrican Any known issues with execution time? Any sense of approximately how many events could be synced before it times out? Curious if it could run an entire academic year with one execution. Thanks.

ande2413 avatar May 15 '20 17:05 ande2413

Execution time is limited to 360 seconds, processing and syncing a single event takes .3 - .5s on average. With some overhead you will most likely be able to sync 650 to 700 events in a single run (Consecutive runs will continue to add remaining events if the previous run timed out)

jonas0b1011001 avatar May 15 '20 17:05 jonas0b1011001

Thanks, that should be enough then. Gave your project a shout out on YouTube.

https://youtu.be/vPOJT_G2hqE

Cheers,

Richard

On Fri, May 15, 2020 at 1:32 PM jonas0b1011001 [email protected] wrote:

Execution time is limited to 360 seconds, processing and syncing a single event takes .3 - .5s on average. With some overhead you will most likely be able to sync 650 to 700 events in a single run (Consecutive runs will continue to add remaining events if the previous run timed out)

— You are receiving this because you commented. Reply to this email directly, view it on GitHub https://github.com/derekantrican/GAS-ICS-Sync/issues/21#issuecomment-629386658, or unsubscribe https://github.com/notifications/unsubscribe-auth/APTCBLXK7VH7EEUX25CRXJLRRV4BZANCNFSM4GTGB3OA .

ande2413 avatar May 15 '20 18:05 ande2413

Thanks for the shoutout! We definitely want to make this into a full web-app so people don't have to look at the code (and work on that has been "pending" for a while - see #8) but we've got some time & knowledge constraints.

derekantrican avatar May 15 '20 19:05 derekantrican

Hi, just chipping in to add two things:

Firstly - thank you! The project is fantastic, I am using it in parts of the event aggregator for the Data Community: http://datacommunity.dev/ (Microsoft Data Platform folks)

Secondly, I too noticed only one event (out of many) that keeps getting duplicated but it's rare and I cannot work out why. I will do some debugging and come back with more tangible findings.

marcingminski avatar May 15 '20 19:05 marcingminski

Thanks, that should be enough then. Gave your project a shout out on YouTube. https://youtu.be/vPOJT_G2hqE Cheers, Richard

@ande2413 I'm pretty sure we are able to add an option to detect and not override manually changed events. If you need this, feel free to open a separate topic with a feature request.

Secondly, I too noticed only one event (out of many) that keeps getting duplicated but it's rare and I cannot work out why. I will do some debugging and come back with more tangible findings.

Will the duplicate stay in the calendar once it is created or does the script clean it up eventually?

jonas0b1011001 avatar May 15 '20 19:05 jonas0b1011001

seems to be staying forever regardless of the var removeEventsFromCalendar = false/true; I am looking at adding more logging to see what's happening.

marcingminski avatar May 15 '20 19:05 marcingminski

Thanks! I will add that as a feature request.

Sent from my iPhone

On May 15, 2020, at 3:43 PM, jonas0b1011001 [email protected] wrote:

 Thanks, that should be enough then. Gave your project a shout out on YouTube. https://youtu.be/vPOJT_G2hqE Cheers, Richard

@ande2413 I'm pretty sure we are able to add an option to detect and not override manually changed events. If you need this, feel free to open a separate topic with a feature request.

Secondly, I too noticed only one event (out of many) that keeps getting duplicated but it's rare and I cannot work out why. I will do some debugging and come back with more tangible findings.

Will the duplicate stay in the calendar once it is created or does the script clean it up eventually?

— You are receiving this because you were mentioned. Reply to this email directly, view it on GitHub, or unsubscribe.

ande2413 avatar May 15 '20 21:05 ande2413

I've been having this issue with the latest version of the script. It seems to only happen with recurring events, but I have not tested enough to know for sure. There also appears to be a dependence on calendar order in the sourceCalendars array. For example, an event from cal[1] will be duplicated on cal[2] and cal[3], but not cal[0]. I have not been able to reproduce the behavior on demand.

bandtank avatar Apr 13 '21 17:04 bandtank

@bandtank Have a look at #185, sounds like this is the same issue.

jonas0b1011001 avatar Apr 13 '21 17:04 jonas0b1011001

@jonas0b1011001 Yes, that seems to be the same issue. I'll try the latest commit to see if it works.

bandtank avatar Apr 13 '21 17:04 bandtank

After running some tests I found that: ICS-files without any events produced duplicate calenders. Also using non english keybord isnt smart. When I use swedish letters - it creates duplicate calenders.

Wickstroem avatar Sep 03 '21 10:09 Wickstroem

Also using non english keybord isnt smart. When I use swedish letters - it creates duplicate calenders

I was able to reproduce this behavior. Can you confirm that

  1. it is not creating a new duplicate on each execution of the script
  2. the duplicate calendars might randomly dis/reappear after reloading calendar.google.com

jonas0b1011001 avatar Sep 03 '21 11:09 jonas0b1011001

l but was able to resolve it. In my case, I believe the issue came from me Installing it but then also manually running it immediately afterwards by doing the startSync. After doing this the first few times, I thought, well what the hell, I'll just install it and let it do it's own thing a

It's Sept 2021 and I am on v5.6 and had this same issue, which was apparently caused by doing both a "startSync" and "install" as described by aznfury. Every all-day event in my Outlook calendar was copied dozens, then hundreds of times into my Google calendar. Only all-day events were affected. Deleting the Outlook calendar from my Google calendar, uninstalling the GAS-ICS-Sync script, and then installing the GAS-ICS-Sync script again fixed the issue for me.

If hitting both "startSync" and "install" cause replication issues, it would be great for the instructions to specifically warn users from hitting both.

Edit: The duplication started again, but it took over 48h to start. I also just discovered that simply signing out of Google and signing back in fixed the duplication of the all-day events.

d-aleman avatar Sep 27 '21 16:09 d-aleman