From 98b7ab78d5f953045d28b82e244ff6d03d5fd44b Mon Sep 17 00:00:00 2001 From: Dan Stillman Date: Sun, 17 Nov 2013 23:34:19 -0500 Subject: [PATCH] Additional debugging for putContentsAsync freeze --- chrome/content/zotero/xpcom/file.js | 3 +++ chrome/content/zotero/xpcom/fulltext.js | 2 +- 2 files changed, 4 insertions(+), 1 deletion(-) diff --git a/chrome/content/zotero/xpcom/file.js b/chrome/content/zotero/xpcom/file.js index 5a639aad2..9c02f59d5 100644 --- 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 index 3188b04f8..8d192023b 100644 --- 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(