davepar / gcalendarsync

Apps Script for syncing a Google Spreadsheet with Google Calendar
MIT License
161 stars 46 forks source link

Old version falsely updates events that have the same guests but are in a different order #90

Open jassler opened 2 years ago

jassler commented 2 years ago

Suppose I have the following two guests in my sheet:

max@gmail.com, maria@gmail.com

Each time I want to sync my sheet to my calendar, eventDifferences compares the guests received from the calendar event through simple string comparison. However the calendar event often times sends back the guests in a different ordering.

This means if the calendar event has the following list of guests:

[ 'maria@gmail.com', 'max@gmail.com' ]

and we join those to get maria@gmail.com,max@gmail.com, it doesn't equal to the original string in the cell even though it should.