Closed Bug 468723 Opened 14 years ago Closed 14 years ago

Incorrect doModifyItem for CalDAV servers where the inbox matches the calendar uri

Categories

(Calendar :: Provider: CalDAV, defect)

defect
Not set
normal

Tracking

(Not tracked)

RESOLVED FIXED

People

(Reporter: lmarcotte, Assigned: lmarcotte)

Details

Attachments

(1 file)

User-Agent:       Mozilla/5.0 (Macintosh; U; Intel Mac OS X 10.5; en-US; rv:1.9.0.4) Gecko/2008102920 Firefox/3.0.4
Build Identifier: Lightning 0.9

In calDavCalendar.js, doModifyItem, we have:

...
        var wasInBoxItem = false;
        if (this.mItemInfoCache[aNewItem.id].isInBoxItem) {
	    aIgnoreEtag = true;
            wasInBoxItem = true;
        }

This is wrong since it'll prevent to compare the etag on the server (for changes) and will unconditionally overwrite the server's copy with the modified item. Instead, we should have:

        var wasInBoxItem = false;
        if (this.mItemInfoCache[aNewItem.id].isInBoxItem) {
	    aIgnoreEtag = this.mShouldPollInbox;
            wasInBoxItem = true;
        }

Reproducible: Always

Steps to Reproduce:
1.
2.
3.
Whiteboard: [needs patch for code in comment#0]
Attached patch Proposed fixSplinter Review
In this patch we simply get rid of the check to ignore the etag when the item is in the inbox. I don't really see why we should do that. Event if it's for accepting/declining and invitation request, the organizer might has changed the start/end datetime and the attendee might change his mind on his participation status based on this - ie., we shouldn't overwrite unconditionally the server's copy.
Attachment #363583 - Flags: review?(philipp)
Comment on attachment 363583 [details] [diff] [review]
Proposed fix

r=philipp
Attachment #363583 - Flags: review?(philipp) → review+
Daniel, do you remember why you added this piece of code?

Pushed to comm-central <http://hg.mozilla.org/comm-central/rev/23428d5d1bdf>

-> FIXED
Status: UNCONFIRMED → RESOLVED
Closed: 14 years ago
OS: Mac OS X → All
Hardware: x86 → All
Resolution: --- → FIXED
Whiteboard: [needs patch for code in comment#0]
Target Milestone: --- → 1.0
Assignee: nobody → lmarcotte
Target Milestone: 1.0 → 1.0b1
You need to log in before you can comment on or make changes to this bug.