icalendar / icalendar

icalendar.rb main repository

Geek Repo:Geek Repo

Github PK Tool:Github PK Tool

Unable to show event names in Google Calendar when sync

adamaiken89 opened this issue · comments

Hi I am trying to sync the calendar as a link to Google Calendar
However, I found the following issues:

  1. The title shows the url
  2. All event names are displayed as busy

Here is my calendar sample file. Is there the correct one to use in Google Calendar?

BEGIN:VCALENDAR
VERSION:2.0
PRODID:icalendar-ruby
CALSCALE:GREGORIAN
X-WR-CALNAME:Demo Public Project
BEGIN:VEVENT
DTSTAMP:20200327T072842Z
UID:146ee4d7-1ad9-4bf0-a2ea-d1828a79d146
DTSTART:20200101T000000Z
DTEND:20200101T000000Z
CLASS:PRIVATE
DESCRIPTION:Take it to the driveway
SUMMARY:Take out the trash
END:VEVENT
BEGIN:VEVENT
DTSTAMP:20200327T072842Z
UID:71538e72-279e-4bfe-a7c5-2cb19dea698c
DTSTART:20200207T000000Z
DTEND:20200207T000000Z
CLASS:PRIVATE
DESCRIPTION:
SUMMARY:Firm Meeting
END:VEVENT

Sorry for necrobumping this old thread, and I know it's unlikely you would remember, but I would greatly appreciate if you could give any additional context to this or let me know if you found a solution.
I have been trying to figure out a similar issue where despite my best efforts, (changing the CLASS to PUBLIC) whenever Google Calendar imports from a URL it shows all the events as busy with no additional information.

I don't have this problem but I do recall Google Calendar being a bit problematic with how it parses iCalendar.

I think you need to use publish. So: METHOD:PUBLISH (ical.publish). And also ensure CLASS:PUBLIC (event.ip_class = 'PUBLIC'). Alternatively try setting one of these:
SEQUENCE:0
STATUS:CONFIRMED
TRANSP:OPAQUE

I am also having this exact same issue. I am using the method:publish. It does not matter if i set event.ip_class = "PUBLIC" or if it is set to "PRIVATE". Did anyone ever find a solution for this? Thanks for any help!! Here is an example of what is getting pushed

SUMMARY:My Event Title
END:VEVENT
BEGIN:VEVENT
DTSTAMP:20221109T045602Z
UID:ef8f4d91-81ee-4db5-a263-5f2b07483c82
DTSTART;TZID=America/Los_Angeles:20220929T100000
DTEND;TZID=America/Los_Angeles:20220929T103000
CLASS:PUBLIC
DESCRIPTION: These are my notes

@sbobsin Google Calendar implements heavy caching when subscribing to a URL feed, that might be what's tripping you up.

I did manage to get it to work finally, all I needed to do was the CLASS:PUBLIC that @espen mentioned (thanks btw!).

@reisub0 I appreciate you circling back to follow up and am glad you have yours working! I'm still on the hunt for my solution here.

Would you be able to expand on your thoughts about the heavy caching tripping possibly tripping me up?

@sbobsin Haha, no problem. Having spent an annoying (and unnecessary) amount of time getting synchronization to work, I am more than glad to help in any way I can so that others don't waste time.

For me, the problem was when I downloaded the ICal file from my corporate account and manually imported it to GCal, it worked just fine (and showed all the event names), but if I subscribed to it as a URL, for some reason it wasn't working at all. I ended up having to patch it dynamically like so: (the following code is Python but I think it's illustrative)

response = requests.get('https://<corporateURL for calendar.ics>', auth=HTTPBasicAuth('user', 'pass'))

regex = "CLASS:PRIVATE"
subst = "CLASS:PUBLIC"
result = re.sub(regex, subst, response.text, 0, re.MULTILINE)

return Response(content=result, media_type="text/calendar")

This is a really strange thing to have to do, and I have no idea what GCal is doing here to necessitate this, but there are many mentions of issues with GCal subscriptions across different Github projects' issues and in some Google Groups. AFAIK, this works flawlessly in Outlook without needing to do this at all.

Basically, by heavy caching I mean that if you use the Google Calendar feature to subscribe to a URL and you have the problem where all the events are marked as busy. And then you try to fix it by modifying the file that's provided under the URL, even if you delete the calendar feed and recreate it, as long as it is the same URL, the changes might take a long time to get reflected (hours or even a day).

If your endpoint where you're serving the iCal from supports it, you can try adding some harmless query parameters like ?thisIsJustAQueryParameterToBypassTheCache=0 which forces GCal to detect it as its own separate URL and download properly.

I hope that sheds some light on the issue.

@reisub0 Thank you for taking the time to follow up and give that detail! I think it was the google caching, as you suggested. After a few days of having set the ip_class to public, I see the events showing up correctly. phew.

Glad to be of service. Hope this helps other folks as well. :)