Skip to content

Commit

Permalink
Bumped to v31.0.4 and fixed #3770 and #3072
Browse files Browse the repository at this point in the history
  • Loading branch information
extrafu committed Jul 22, 2016
1 parent 0b0959b commit 7595bae
Show file tree
Hide file tree
Showing 11 changed files with 55 additions and 26 deletions.
3 changes: 3 additions & 0 deletions RELEASE-NOTES
Original file line number Diff line number Diff line change
@@ -1,5 +1,8 @@
NEWS
====
31.0.4 Handle 412 (precondition failed) when sync'ing cards (server always win) (#3072)
Fixed editing of categories from context menu (#3770)

31.0.3 Fixed autocomplete issue with Thunderbird 45
Now perform PUT and DELETE ops synchronously (PR#13)
Set the "If-None-Match" when adding a contact
Expand Down
7 changes: 5 additions & 2 deletions chrome/content/inverse-library/sogoWebDAV.js
Original file line number Diff line number Diff line change
@@ -1,6 +1,6 @@
/* sogoWebDAV.js - This file is part of "SOGo Connector", a Thunderbird extension.
*
* Copyright: Inverse inc., 2006-2014
* Copyright: Inverse inc., 2006-2016
*
* "SOGo Connector" is free software; you can redistribute it and/or modify it
* under the terms of the GNU General Public License version 2 as published by
Expand Down Expand Up @@ -263,6 +263,9 @@ sogoWebDAV.prototype = {
if (status == 499) {
dump("xmlRequest: received status 499 for url: " + this.url + "\n");
}
else if (status == 412) {
dump("xmlRequest: received status 412 - precondition failed for url: " + this.url + "\n");
}
else {
let visitor = {};
visitor.visitHeader = function(aHeader, aValue) {
Expand Down Expand Up @@ -314,7 +317,7 @@ sogoWebDAV.prototype = {
}
catch(e) {
dump("sogoWebDAV.js: an exception occured\n" + e + "\n"
+ e.fileName + ":" + e.lineNumber + "\n");
+ e.fileName + ":" + e.lineNumber + "\n\nstack: " + e.stack);
let uri = aChannel.URI;
if (uri) {
dump("url: " + uri.spec + "\n");
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -284,7 +284,9 @@ abDirTreeObserver._resetDroppedCardsVersionFromSession = function(dragSession, a
attributes.version = "-1";
}
else {
card.setProperty("groupDavVersion", "-1");
let oldDavVersion = card.getProperty("groupDavVersion", "-1");
card.setProperty("groupDavVersion", "-1");
card.setProperty("groupDavVersionPrev", oldDavVersion);
abView.directory.modifyCard(card);
}
}
Expand Down Expand Up @@ -764,7 +766,7 @@ function SCOnCategoriesContextMenuItemCommand(event) {
let cards = GetSelectedAbCards();
if (cards.length > 0) {
let requireSync = false;
let abUri = GetSelectedDirectory();
let abUri = null;
let category = this.label;
let set = !this.hasAttribute("checked");
for (let i = 0; i < cards.length; i++) {
Expand Down Expand Up @@ -798,13 +800,26 @@ function SCOnCategoriesContextMenuItemCommand(event) {
}
if (changed) {
requireSync = true;
card.setProperty("Categories", cats);
card.setProperty("groupDavVersion", "-1");

let oldDavVersion = card.getProperty("groupDavVersion", "-1");
card.setProperty("groupDavVersion", "-1");
card.setProperty("groupDavVersionPrev", oldDavVersion);
card.setProperty("Categories", cats);

let abManager = Components.classes["@mozilla.org/abmanager;1"]
.getService(Components.interfaces.nsIAbManager);
let ab = abManager.getDirectory(abUri);
ab.modifyCard(card);
}
.getService(Components.interfaces.nsIAbManager);
let children = abManager.directories;
while (children.hasMoreElements()) {
let ab = children.getNext().QueryInterface(Components.interfaces.nsIAbDirectory);
if (ab.isRemote || ab.isMailList)
continue;
if (ab.hasCard(card)) {
ab.modifyCard(card);
abUri = ab.URI;
break;
}
}
}
}
if (requireSync) {
if (isGroupdavDirectory(abUri)) {
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -14,7 +14,6 @@ function jsInclude(files, target) {
}

jsInclude(["chrome://sogo-connector/content/addressbook/categories.js",
"chrome://sogo-connector/content/general/vcards.utils.js",
"chrome://sogo-connector/content/general/sync.addressbook.groupdav.js",
"chrome://sogo-connector/content/general/preference.service.addressbook.groupdav.js"]);

Expand Down
Original file line number Diff line number Diff line change
@@ -1,6 +1,6 @@
/* messenger.groupdav.overlay.js - This file is part of "SOGo Connector", a Thunderbird extension.
*
* Copyright: Inverse inc., 2006-2014
* Copyright: Inverse inc., 2006-2016
* Email: support@inverse.ca
* URL: http://inverse.ca
*
Expand Down
Original file line number Diff line number Diff line change
@@ -1,6 +1,6 @@
/* preferences.addressbook.groupdav.js - This file is part of "SOGo Connector", a Thunderbird extension.
*
* Copyright: Inverse inc., 2006-2014
* Copyright: Inverse inc., 2006-2016
* Email: support@inverse.ca
* URL: http://inverse.ca
*
Expand Down
Original file line number Diff line number Diff line change
@@ -1,7 +1,6 @@
/* mozilla.utils.inverse.ca.js - This file is part of "SOGo Connector", a Thunderbird extension.
*
* Copyright: Inverse inc., 2006-2012
* Author: Robert Bolduc, Wolfgang Sourdeau
* Copyright: Inverse inc., 2006-2016
* Email: support@inverse.ca
* URL: http://inverse.ca
*
Expand Down
Original file line number Diff line number Diff line change
@@ -1,6 +1,6 @@
/* preference.service.addressbook.groupdav.js - This file is part of "SOGo Connector", a Thunderbird extension.
*
* Copyright: Inverse inc., 2006-2014
* Copyright: Inverse inc., 2006-2016
* Email: support@inverse.ca
* URL: http://inverse.ca
*
Expand Down
25 changes: 18 additions & 7 deletions chrome/content/sogo-connector/general/sync.addressbook.groupdav.js
Original file line number Diff line number Diff line change
@@ -1,6 +1,6 @@
/* sync.addressbook.groupdav.js - This file is part of "SOGo Connector", a Thunderbird extension.
*
* Copyright: Inverse inc., 2006-2014
* Copyright: Inverse inc., 2006-2016
* Email: support@inverse.ca
* URL: http://inverse.ca
*
Expand Down Expand Up @@ -386,7 +386,7 @@ GroupDavSynchronizer.prototype = {
else if (data.query == "server-sync-query")
this.onServerSyncQueryComplete(status, response);
else if (data.query == "card-upload")
this.onCardUploadComplete(status, response, data.key, data.data, headers);
this.onCardUploadComplete(status, response, data.key, data.data, headers);
else if (data.query == "list-upload")
this.onListUploadComplete(status, response, data.key, data.data, headers);
else if (data.query == "server-finalize-propfind")
Expand Down Expand Up @@ -517,12 +517,23 @@ GroupDavSynchronizer.prototype = {
let console = Components.classes["@mozilla.org/consoleservice;1"]
.getService(Components.interfaces.nsIConsoleService);

this.appendFailure(status, card);
if (status == 412) {
console.logStringMessage("Precondition failed for card: " + cardURL
+ ".\nHTTP Status Code:" + status + "\nRedownloading!");
let data = {query: "vcard-download", data: key};
let itemDict = { etag: headers["etag"], type: "text/vcard" };
this.serverDownloads[key] = itemDict;
this.serverDownloadsCount++;
this.remainingDownloads++;
let request = new sogoWebDAV(cardURL, this, data);
request.get("text/vcard");
}
else {
this.appendFailure(status, card);
console.logStringMessage("Upload failure uploading card: " + cardURL
+ ".\nHTTP Status Code:" + status + "\n" + this.cardToString(card));
}
this.localUploads--;


console.logStringMessage("Upload failure uploading card: " + cardURL
+ ".\nHTTP Status Code:" + status + "\n" + this.cardToString(card));
}

this.progressMgr.updateAddressBook(this.gURL);
Expand Down
3 changes: 1 addition & 2 deletions chrome/content/sogo-connector/general/vcards.utils.js
Original file line number Diff line number Diff line change
@@ -1,7 +1,6 @@
/* vcards.utils.js - This file is part of "SOGo Connector", a Thunderbird extension.
*
* Copyright: Inverse inc., 2006-2010
* Author: Robert Bolduc, Wolfgang Sourdeau
* Copyright: Inverse inc., 2006-2016
* Email: support@inverse.ca
* URL: http://inverse.ca
*
Expand Down
2 changes: 1 addition & 1 deletion install.rdf
Original file line number Diff line number Diff line change
Expand Up @@ -5,7 +5,7 @@
<Description about="urn:mozilla:install-manifest"
em:name="Inverse SOGo Connector"
em:id="sogo-connector@inverse.ca"
em:version="31.0.3"
em:version="31.0.4"
em:description="A DAV plugin for keeping addressbooks and events in sync"
em:iconURL="chrome://sogo-connector/skin/addressbook/sogo.png"
em:creator="Inverse &lt;support@inverse.ca>"
Expand Down

0 comments on commit 7595bae

Please sign in to comment.