Last Comment Bug 774211 - PUBLISH does not allow update (SEQUENCE)
: PUBLISH does not allow update (SEQUENCE)
Status: RESOLVED FIXED
:
Product: Calendar
Classification: Client Software
Component: E-mail based Scheduling (iTIP/iMIP) (show other bugs)
: Lightning 1.6
: All All
: -- normal (vote)
: 1.8
Assigned To: klaus
:
Mentors:
Depends on:
Blocks:
  Show dependency treegraph
 
Reported: 2012-07-16 02:30 PDT by klaus
Modified: 2012-09-29 10:18 PDT (History)
4 users (show)
See Also:
Crash Signature:
(edit)
QA Whiteboard:
Iteration: ---
Points: ---


Attachments
FIX allows to update an already received PUBLISHed event for 1.4 (55.29 KB, text/plain)
2012-07-16 12:32 PDT, klaus
no flags Details
allow to add PUBLISHed events to calendar, replace typo (newItem= updateItem(newItem..) by newItem= updateItem(item...)) (275 bytes, patch)
2012-07-24 05:07 PDT, klaus
no flags Details | Diff | Review
allow to add PUBLISHed events to calendar, replace typo (newItem= updateItem(newItem..) by newItem= updateItem(item...)) (1.42 KB, patch)
2012-08-05 02:34 PDT, Stefan Sitter
philipp: review+
philipp: approval‑calendar‑aurora+
philipp: approval‑calendar‑beta+
Details | Diff | Review

Description klaus 2012-07-16 02:30:37 PDT
User Agent: Mozilla/5.0 (compatible; MSIE 9.0; Windows NT 6.1; Trident/5.0; SLCC2; .NET CLR 2.0.50727; .NET CLR 3.5.30729; .NET CLR 3.0.30729; Media Center PC 6.0; Tablet PC 2.0)

Steps to reproduce:

update an event already added to calendar using PUBLISH
(by using SEQUENCE=xx)

if METHOD=REQUEST in same itip email, this works.


Actual results:

IMIP bar has no buttons.

error console reports error in line 840

looking at code, it seems to recognise that update is requested, but cannot clone item in function function updateItem(item, itipItemItem) {

->lookup of UID went wrong (my speculation about it)

Klaus


see below

first error:
Zeitstempel: 16.07.2012 11:24:01
Fehler: [Exception... "'[JavaScript Error: "item is undefined" {file: "resource://calendar/modules/calItipUtils.jsm" line: 840}]' when calling method: [calIOperationListener::onOperationComplete]"  nsresult: "0x80570021 (NS_ERROR_XPC_JAVASCRIPT_ERROR_WITH_DETAILS)"  location: "JS frame :: file:///C:/Users/kbuecher/AppData/Roaming/Thunderbird/Profiles/oq7e67ge.default/extensions/%7Be2fda1a4-762b-4020-b5ad-a41df1933103%7D/components/calCompositeCalendar.js :: <TOP_LEVEL> :: line 566"  data: yes]

following errors:

Zeitstempel: 16.07.2012 11:24:01
Fehler: item is undefined
Quelldatei: resource://calendar/modules/calItipUtils.jsm
Zeile: 840


Expected results:

display an update button in imip bar
Comment 1 klaus 2012-07-16 12:24:05 PDT
FIX for this bug:

calItipUtils.jsm, in function onOperationComplete:

in the following block, replace newItem by item in the call of updateItem by item

wrong call: let newItem = updateItem(newItem, itipItemItem);
correct call: let newItem = updateItem(item, itipItemItem);

it is obvious that the first cannot work.

(compare also the REQUEST further down block with identical call of updateItem)

commented line: original, uncommented line: this solves the bug, update can be added to calendar.

                                case "PUBLISH":
                                    cal.ASSERT(itipItemItem.getAttendees({}).length == 0,
                                               "invalid number of attendees in PUBLISH!");
                                    if (item.calendar.getProperty("itip.disableRevisionChecks") ||
                                        cal.itip.compare(itipItemItem, item) > 0) {
                                        let newItem = updateItem(item, itipItemItem);
//                                        let newItem = updateItem(newItem, itipItemItem);
                                        let action = function(opListener) {
                                            return newItem.calendar.modifyItem(newItem, item, opListener);
                                        };
                                        actionMethod = method + ":UPDATE";
                                        operations.push(action);
                                    }
                                    break;


all tested in lightning 1.4
Klaus
Comment 2 klaus 2012-07-16 12:32:00 PDT
Created attachment 642680 [details]
FIX allows to update an already received PUBLISHed event for 1.4
Comment 3 klaus 2012-07-24 05:07:21 PDT
Created attachment 645263 [details] [diff] [review]
allow to add PUBLISHed events to calendar, replace typo (newItem= updateItem(newItem..) by newItem= updateItem(item...))

FIX for 1.6: 
In 
ItipFindItemListener.prototype = {
 
    onOperationComplete:

in 
case "PUBLISH":

replace 
let newItem=updateItem(newItem... 
(this call is circular and cannot work)

by 
let newItem=updateItem(item...

this is then identical to case: "REQUEST" and allows to add PUBLISHed events to a calendar

Klaus
Comment 4 klaus 2012-08-05 01:54:02 PDT
same problem and fix for LT 1.6
Comment 5 Stefan Sitter 2012-08-05 02:34:00 PDT
Created attachment 649084 [details] [diff] [review]
allow to add PUBLISHed events to calendar, replace typo (newItem= updateItem(newItem..) by newItem= updateItem(item...))

Hello klaus, thank you for reporting the problem and its investigation. I took the liberty to convert your proposed fix into a proper patch and request review from the correct calendar peer for you.
Comment 6 Stefan Sitter 2012-08-27 10:19:21 PDT
Philipp, do you think we can take this obvious bug fix for 1.9 and even perhaps 1.8?
Comment 7 Philipp Kewisch [:Fallen] 2012-09-29 10:15:59 PDT
Comment on attachment 649084 [details] [diff] [review]
allow to add PUBLISHed events to calendar, replace typo (newItem= updateItem(newItem..) by newItem= updateItem(item...))

I think we can take this for 1.8, lets do it. Thanks for the patch!
Comment 8 Philipp Kewisch [:Fallen] 2012-09-29 10:17:53 PDT
Pushed to comm-central changeset 85acb9d2e738
Comment 9 Philipp Kewisch [:Fallen] 2012-09-29 10:18:11 PDT
Backported to releases/comm-aurora changeset 5bb30d69b276
Comment 10 Philipp Kewisch [:Fallen] 2012-09-29 10:18:36 PDT
Backported to releases/comm-beta changeset fa9f0f558147

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