From cae2b10af6eb232e5ba8293c7dfb6153d73d3e8e Mon Sep 17 00:00:00 2001 From: Scott Nonnenberg Date: Tue, 7 Nov 2017 10:49:10 -0800 Subject: [PATCH] Increase web request timeout, drop failed delivery receipts (#1699) Increase web request timeout, drop failed delivery receipts, export error logging --- js/backup.js | 4 ++-- js/delivery_receipts.js | 1 + js/libtextsecure.js | 2 +- libtextsecure/api.js | 2 +- 4 files changed, 5 insertions(+), 4 deletions(-) diff --git a/js/backup.js b/js/backup.js index b589024b8..473b7a048 100644 --- a/js/backup.js +++ b/js/backup.js @@ -630,8 +630,8 @@ } }; request.onerror = function(event) { - console.log('Error adding object to store:', error); - reject(); + console.log('Error adding object to store:', event); + reject(new Error('saveAllMessage: onerror fired')); }; }); }); diff --git a/js/delivery_receipts.js b/js/delivery_receipts.js index e4289a57f..63147fe7b 100644 --- a/js/delivery_receipts.js +++ b/js/delivery_receipts.js @@ -67,6 +67,7 @@ receipt.get('source'), receipt.get('timestamp') ); + resolve(); } }.bind(this)).catch(function(error) { console.log( diff --git a/js/libtextsecure.js b/js/libtextsecure.js index fa5d03ea0..04ce5806f 100644 --- a/js/libtextsecure.js +++ b/js/libtextsecure.js @@ -37474,7 +37474,7 @@ var TextSecureServer = (function() { url = options.host + '/' + options.path; } console.log(options.type, url); - var timeout = typeof options.timeout !== 'undefined' ? options.timeout : 5000; + var timeout = typeof options.timeout !== 'undefined' ? options.timeout : 10000; var fetchOptions = { method: options.type, diff --git a/libtextsecure/api.js b/libtextsecure/api.js index 0c20d8416..73e5f08a0 100644 --- a/libtextsecure/api.js +++ b/libtextsecure/api.js @@ -37,7 +37,7 @@ var TextSecureServer = (function() { url = options.host + '/' + options.path; } console.log(options.type, url); - var timeout = typeof options.timeout !== 'undefined' ? options.timeout : 5000; + var timeout = typeof options.timeout !== 'undefined' ? options.timeout : 10000; var fetchOptions = { method: options.type,