Closed Bug 1126338 Opened 9 years ago Closed 9 years ago

Cannot create Google event with addItem() with attendees and no organizer

Categories

(Calendar :: Provider: GData, defect)

Lightning 3.3
defect
Not set
normal

Tracking

(Not tracked)

RESOLVED FIXED
4.0.0.1

People

(Reporter: chris, Assigned: Fallen)

Details

Attachments

(1 file)

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 && aItem.organizer.id == attendee.id) {

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.
Events/Tasks without an organizer, that have attendees are violating RfC5545, so I suggest a WONTFIX here. See http://tools.ietf.org/html/rfc5545#section-3.8.4.3 (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.
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.
Attached patch Fix - v1 β€” β€” Splinter Review
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.
Assignee: nobody → philipp
Status: UNCONFIRMED → ASSIGNED
Ever confirmed: true
Attachment #8560911 - Flags: review?(makemyday)
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?
Attachment #8560911 - Flags: review?(makemyday)
Attachment #8560911 - Flags: review+
Attachment #8560911 - Flags: feedback?(chris)
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.
Pushed to comm-central changeset ed5ead86a43d
Status: ASSIGNED → RESOLVED
Closed: 9 years ago
Keywords: checkin-needed
Resolution: --- → FIXED
Target Milestone: --- → 4.0
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.
Attachment #8560911 - Flags: feedback?(chris)
You need to log in before you can comment on or make changes to this bug.

Attachment

General

Created:
Updated:
Size: