Uncaught TypeError: cal.itip.getInvitedAttendee Errors with a addon using ACLs
Categories
(Calendar :: E-mail based Scheduling (iTIP/iMIP), defect)
Tracking
(Not tracked)
People
(Reporter: cn, Unassigned)
Details
Attachments
(2 files)
2.90 KB,
text/calendar
|
Details | |
1.07 KB,
patch
|
adi
:
checkin+
|
Details | Diff | Splinter Review |
User Agent: Mozilla/5.0 (X11; Fedora; Linux x86_64; rv:94.0) Gecko/20100101 Firefox/94.0
Steps to reproduce:
In the Thunderbird calendar if a plugin/addon enables ACLs there are errors in synchronizing and TB becomes unusable.
The example event I attached triggered the bug - because no PARTSTAT is present on the ORGANIZER for that event.
When ACLs are enabled, some code path changes in Thunderbird as without the plugin/addon (SOGo-Connector) the error is not there. However, it happen in the code provided by TB and not in the plugin itself.
Comment from the developer of the plugin "I think some safety checks are missing in Thunderbird - where it tries to read the partstat of the organizer which is missing in this case for the event "
If you export the calendar every event is there so it is not a synchronization issue.
I have attached the errors shown in the console when such an event is synchronized.
Any help would be much appreciated.
Actual results:
Errors in the console are:
Uncaught TypeError: cal.itip.getInvitedAttendee(...) is null
setCSSClasses chrome://calendar/content/calendar-editable-item.js:363
set occurrence chrome://calendar/content/calendar-editable-item.js:198
relayout chrome://calendar/content/calendar-event-column.js:640
deleteEvent chrome://calendar/content/calendar-event-column.js:462
doRemoveItem chrome://calendar/content/calendar-multiday-view.js:1896
removeItemsFromCalendar
chrome://calendar/content/calendar-multiday-view.js:1925
execute chrome://calendar/content/calendar-base-view.js:298
addItemsFromCalendar
chrome://calendar/content/calendar-base-view.js:822
refresh chrome://calendar/content/calendar-base-view.js:801
get chrome://global/content/customElements.js:696
onLoad chrome://calendar/content/calendar-base-view.js:55
notify resource:///modules/calendar/utils/calDataUtils.jsm:38
notify resource:///modules/calendar/utils/calDataUtils.jsm:65
onLoad resource:///modules/CalCompositeCalendar.jsm:30
notify resource:///modules/calendar/utils/calDataUtils.jsm:38
notify resource:///modules/calendar/utils/calDataUtils.jsm:65
onLoad resource:///components/calCachedCalendar.js:69
downstreamRefresh resource:///components/calCachedCalendar.js:725
execResponseFunc resource:///components/calCachedCalendar.js:323
emptyQueue resource:///components/calCachedCalendar.js:328
onResult resource:///components/calCachedCalendar.js:358
finalizeUpdatedItems resource:///modules/CalDavCalendar.jsm:1088
endDocument resource:///modules/caldav/CalDavRequestHandlers.jsm:557
handleResponse resource:///modules/caldav/CalDavRequestHandlers.jsm:61
calendar-editable-item.js:363:20
[Exception... "[JavaScript Error: "cal.itip.getInvitedAttendee(...) is
null" {file: "chrome://calendar/content/calendar-editable-item.js" line:
363}]'[JavaScript Error: "cal.itip.getInvitedAttendee(...) is null"
{file: "chrome://calendar/content/calendar-editable-item.js" line:
363}]' when calling method: [calIObserver::onLoad]" nsresult:
"0x80570021 (NS_ERROR_XPC_JAVASCRIPT_ERROR_WITH_DETAILS)" location: "JS
frame :: resource:///modules/calendar/utils/calDataUtils.jsm :: notify
:: line 38" data: yes] calDataUtils.jsm:38:23
Expected results:
TB should work correctly with ACLs enabled.
Comment 1•3 years ago
|
||
if a plugin/addon enables ACLs
Can you explain more how ACLs (Access Control Lists, i.e. user rights management to data on an account/folder/message level) are being "enabled"? Is that a setting? An API that the addon calls?
In other words, can you please provide a list of mouse clicks that reproduces the bug here? If it's possible to reproduce the bug without an addon, that would be ideal. If it's impossible, then please include the addon in the reproduction steps. Also include any account setup. The first step to fixing is to let the developer see the bug on his own computer.
The original patch that introduced the hooks or stups for ACLs was discussed in this bug report (https://bugzilla.mozilla.org/show_bug.cgi?id=586276). The patch came from the same developer as our Plugin. The SOGo Connector is from Inverse.
Is the info from that old bug report enough with regards how this is activated?
As for reproduction I can provide a test account on our system. I'll need some time to set this up.
The plugin is hardcoded to our servers.
The bug does not happen without the plugin.
Updated•3 years ago
|
Updated•3 years ago
|
Comment 3•2 years ago
|
||
We do experience the same or similar issues in chrome://calendar/content/calendar-editable-item.js:396 caused by the following statement:
cal.itip.getInvitedAttendee(item).participationStatus
because cal.itip.getInvitedAttendee(item)
returns null
and null.participationStatus
obviously fails. We mitigated the issue by extending the conditional with a check for exactly this:
// Invitation.
if (cal.itip.isInvitation(item) && cal.itip.getInvitedAttendee(item)) {
this.setAttribute(
"invitation-status",
cal.itip.getInvitedAttendee(item).participationStatus
);
}
I have no idea whether this is a proper fix for the issue, but with that change we're able to view calendars again and can be sure to not miss an event again. I'd love to have some fix for that issue upstream. Please let us know if we could be of any more help.
Comment 4•2 years ago
|
||
Judging from the code of getInvitedAttendee(item)
in resource:///modules/calendar/utils/calProviderUtils.jsm:806 (to 823), returning null
is the default value:
// calIAttendee getInvitedAttendee(in calIItemBase aItem);
getInvitedAttendee(aItem) {
let id = this.getProperty("organizerId");
let attendee = id ? aItem.getAttendeeById(id) : null;
if (!attendee && this.mACLEntry && this.mACLEntry.hasAccessControl) {
let ownerIdentities = this.mACLEntry.getOwnerIdentities();
if (ownerIdentities.length > 0) {
let identity;
for (let i = 0; !attendee && i < ownerIdentities.length; i++) {
identity = "mailto:" + ownerIdentities[i].email.toLowerCase();
attendee = aItem.getAttendeeById(identity);
}
}
}
return attendee;
}
This means, our fix is not just a fix but the only way to call that method in this context: One has to expect that this function call may return null
!
There are other locations where getInvitedAttendee(item)
is used as it should be, like in chrome://calendar/content/calendar-invitations-dialog.js:181:
setCalendarItemParticipationStatus(item, status) {
if (item.calendar?.supportsScheduling) {
let att = item.calendar.getSchedulingSupport().getInvitedAttendee(item);
if (att) {
let att_ = att.clone();
att_.participationStatus = status;
// Update attendee
item.removeAttendee(att);
item.addAttendee(att_);
return true;
}
}
return false;
}
So, to me this is a bug in Thunderbird's core code lurking there to trigger all kinds of strange problems. In our case users have empty days in their calendars caused by incomplete event renderings due to exceptions trying to call null
.
Hi can someone comment if this fix is something that would be excepted into the TB code? The Bug is 2 years old there is a fix and nothing more happens?
Comment 6•11 months ago
|
||
The bug still exists in all recent versions of Thunderbird and it is quite nasty and time consuming to fix them on every machine after every update. Is there anything I can do to help getting the fix upstream?
As outlined above, getInvitedAttendee(item)
returns null
if no organizerId
can be found. Thus using it the way it is currently done is unsafe and needs to be fixed.
Comment 7•9 months ago
|
||
Find attached a patch that fixes the issue. To sum up the issue again:
cal.itip.getInvitedAttendee(item)
will return NULL
in case no organizer can be found in the event (organizerId
). The direct call to cal.itip.getInvitedAttendee(item).participationStatus
will fail in such cases and lead to incomplete calendar renderings.
The attached patch fixes these cases by checking for NULL
before doing the call.
Comment 8•9 months ago
|
||
direct calls to cal.itip.getInvitedAttendee(item).participationStatus
:
- https://hg.mozilla.org/comm-central/file/tip/calendar/base/content/calendar-editable-item.js#l395
- https://hg.mozilla.org/comm-central/file/tip/calendar/base/content/today-pane-agenda.js#l599
Definition of getInvitedAttendee
:
Description
•