Last Comment Bug 1126338 - Cannot create Google event with addItem() with attendees and no organizer
: Cannot create Google event with addItem() with attendees and no organizer
Product: Calendar
Classification: Client Software
Component: Provider: GData (show other bugs)
: Lightning 3.3
: All All
-- normal (vote)
Assigned To: Philipp Kewisch [:Fallen]
Depends on:
  Show dependency treegraph
Reported: 2015-01-27 07:54 PST by Chris
Modified: 2015-02-11 08:53 PST (History)
2 users (show)
See Also:
Crash Signature:
QA Whiteboard:
Iteration: ---
Points: ---

Fix - v1 (669 bytes, patch)
2015-02-07 11:28 PST, Philipp Kewisch [:Fallen]
makemyday: review+
Details | Diff | Splinter Review

Description User image Chris 2015-01-27 07:54:53 PST
User Agent: Mozilla/5.0 (Windows NT 6.3; WOW64) AppleWebKit/537.36 (KHTML, like Gecko) Chrome/40.0.2214.91 Safari/537.36

Steps to reproduce:

Provider for Google Calendar version 1.0.3, Lightning 3.3.2 and Thunderbird 31.4.0.

Create an event with calIICalendar::addItem() with an attendee but no organizer.

Actual results:

addItem() fails and returns an error.

[calGoogleCalendar] Adding Item ... failed:2147500037: aItem.organizer is null"]

This is problematic when synchronizing invitations from Windows Mobile devices where there is no notion of organizer.

Expected results:

The following patch in gdataUtils.jsm, line 275 seems working and addItem() no longer returns an error:

            // PATCH: aItem.organizer != null added
            if (aItem.organizer && == {

I also noticed that now, like in other providers, the attendee identifier needed "mailto:" prefix if it is an email (it may not have been the case in previous versions of Provider for Google Calendar). BirdieSync will be modified accordingly.

I also could see that after being created with Undefined Meeting Status, it was automatically updated to "Confirmed". This behavior seems identical when manually creating an event in Lightning. Note sure if it's intended or not.

Thank you for your help.
Comment 1 User image [:MakeMyDay] 2015-01-27 11:58:53 PST
Events/Tasks without an organizer, that have attendees are violating RfC5545, so I suggest a WONTFIX here. See (having attendees -> group scheduling). Do you syncing ical or TNEF based events (TNEF is not support, see bug 454705)? Accepting this would lead to problems, if the user subsequently tries to deal with the events in Lightning.
Comment 2 User image Chris 2015-01-27 13:42:47 PST
Yes, I know that having no organizer doesn't respect RFC 5545. The problem is that I need to synchronize events/invitations from Windows Mobile devices which don't have the notion of an organizer (the calendar is not attached to a specific email for instance and invitations synchronized from Outlook don't necessarily have an organizer) and it's possible to manually create an event with only attendees. Note that synchronizing Windows Mobile device events (which don't follow a specific norm I guess) have been done for years.
It could be possible to choose a default organizer (like the owner of the Google calendar) but I don't find this solution satisfactory either since we cannot know who organized the event.
I understand that you want to be cautious regarding the management of a lacking organizer. It was possible before I think (and in other places in the code there are tests to see if organizer is null or not). I don't know if it could lead to problems with last modifications in the provider or future evolutions.
Comment 3 User image Philipp Kewisch [:Fallen] 2015-02-07 11:28:01 PST
Created attachment 8560911 [details] [diff] [review]
Fix - v1

Fair enough, won't really hurt to add this line to guard if there is no organizer set. Note however that adding an item to a Google Calendar without an organizer set will cause the server to add the organizer, so as soon as this item comes back from the server it will have one.
Comment 4 User image [:MakeMyDay] 2015-02-07 13:59:20 PST
Comment on attachment 8560911 [details] [diff] [review]
Fix - v1

Review of attachment 8560911 [details] [diff] [review]:

Given that the server adds the organizer, r=MakeMyDay.

But I still would appreciate BirdieSync to take care to add the organizer beforehand. Even if the server adds the organizer anyway, that would prevent any edge cases where Lightning expects an organizer to deal correctly with an event prior it's retrived back from the server (and ByrdieSync can decide that way whom to define as organizer instead of Google btw). Chris, what do you think?
Comment 5 User image Philipp Kewisch [:Fallen] 2015-02-07 14:08:25 PST
Note also that if the organizer is unset and gets set by the server, subsequent modifications will cause email invitations to go out unless the pref is set to disable them completely. Events can be imported as-is, please see that invitations hack that uses a different method for importing events for details. I'm not sure how that method would handle a missing organizer though, you'd have to give it a try.
Comment 6 User image Philipp Kewisch [:Fallen] 2015-02-08 06:06:50 PST
Pushed to comm-central changeset ed5ead86a43d
Comment 7 User image Chris 2015-02-09 09:36:30 PST
Thanks a lot Philipp for the fix. I'll see how it is possible to follow MakeMyDay recommendation and add a default organizer even if it's not set in the original event. Anyway, in more recent devices, I think an organizer should be present in events with attendees. I'll also check again invitations sending.

Note You need to log in before you can comment on or make changes to this bug.