commit 98b7ab78d5f953045d28b82e244ff6d03d5fd44b
parent f2034eec290ddddbb90df9f1b548b17a3802ec63
Author: Dan Stillman <dstillman@zotero.org>
Date: Sun, 17 Nov 2013 23:34:19 -0500
Additional debugging for putContentsAsync freeze
Diffstat:
2 files changed, 4 insertions(+), 1 deletion(-)
diff --git a/chrome/content/zotero/xpcom/file.js b/chrome/content/zotero/xpcom/file.js
@@ -248,6 +248,7 @@ Zotero.File = new function(){
if (typeof data == 'string'
&& Zotero.platformMajorVersion >= 19
&& (!charset || charset.toLowerCase() == 'utf-8')) {
+ Zotero.debug('Saving contents using OS.File');
let encoder = new TextEncoder();
let array = encoder.encode(data);
return Q(OS.File.writeAtomic(
@@ -258,6 +259,7 @@ Zotero.File = new function(){
}
))
.catch(function (e) {
+ Zotero.debug(e); // TEMP
if (e instanceof OS.File.Error) {
Zotero.debug(e);
Zotero.debug(e.toString());
@@ -267,6 +269,7 @@ Zotero.File = new function(){
});
}
else {
+ Zotero.debug('Saving contents using asyncCopy');
// Create a stream for async stream copying
if(!(data instanceof Components.interfaces.nsIInputStream)) {
var converter = Components.classes["@mozilla.org/intl/scriptableunicodeconverter"].
diff --git a/chrome/content/zotero/xpcom/fulltext.js b/chrome/content/zotero/xpcom/fulltext.js
@@ -929,7 +929,7 @@ Zotero.Fulltext = new function(){
cacheFile = self.getItemCacheFile(itemID);
Zotero.debug("Writing full-text content to " + cacheFile.path);
- return Zotero.File.putContentsAsync(cacheFile, data.text, "UTF-8");
+ return Zotero.File.putContentsAsync(cacheFile, data.text);
})
.then(function () {
Zotero.Fulltext.indexString(