Skip to content

Commit cc8e128

Browse files
breadcrumbs for bugreports
1 parent d096d47 commit cc8e128

File tree

2 files changed

+12
-3
lines changed

2 files changed

+12
-3
lines changed

src/js/controllers/index.js

Lines changed: 10 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -9,9 +9,11 @@ var walletDefinedByKeys = require('byteballcore/wallet_defined_by_keys.js');
99
var eventBus = require('byteballcore/event_bus.js');
1010
var objectHash = require('byteballcore/object_hash.js');
1111
var ecdsaSig = require('byteballcore/signature.js');
12+
var breadcrumbs = require('byteballcore/breadcrumbs.js');
1213
var Bitcore = require('bitcore-lib');
1314

1415
angular.module('copayApp.controllers').controller('indexController', function($rootScope, $scope, $log, $filter, $timeout, lodash, go, profileService, configService, isCordova, storageService, addressService, gettext, gettextCatalog, amMoment, nodeWebkit, addonManager, txFormatService, uxLanguage, $state, isMobile, addressbookService, notification, animationService, $modal, bwcService) {
16+
breadcrumbs.add('index.js');
1517
var self = this;
1618
self.isCordova = isCordova;
1719
self.isSafari = isMobile.Safari();
@@ -58,7 +60,12 @@ angular.module('copayApp.controllers').controller('indexController', function($r
5860
network.findOutboundPeerOrConnect(bug_sink_url, function(err, ws){
5961
if (err)
6062
return;
61-
network.sendJustsaying(ws, 'bugreport', {message: error_message, exception: error_object.stack || error_object});
63+
breadcrumbs.add('bugreport');
64+
var description = error_object.stack || JSON.stringify(error_object, null, '\t');
65+
description += "\n\nBreadcrumbs:\n"+breadcrumbs.get().join("\n")+"\n\n";
66+
description += "UA: "+navigator.userAgent+"\n";
67+
description += "Program: "+conf.program+' '+conf.program_version+"\n";
68+
network.sendJustsaying(ws, 'bugreport', {message: error_message, exception: description});
6269
});
6370
}
6471

@@ -851,7 +858,7 @@ angular.module('copayApp.controllers').controller('indexController', function($r
851858
self.updateLocalTxHistory = function(client, cb) {
852859
var walletId = client.credentials.walletId;
853860

854-
client.getTxHistory(self.arrBalances[self.assetIndex].asset, function(txs) {
861+
client.getTxHistory(self.arrBalances[self.assetIndex].asset, function onGotTxHistory(txs) {
855862
var newHistory = self.processNewTxs(txs);
856863
$log.debug('Tx History synced. Total Txs: ' + newHistory.length);
857864

@@ -888,7 +895,7 @@ angular.module('copayApp.controllers').controller('indexController', function($r
888895
self.txHistoryError = false;
889896
self.updatingTxHistory[walletId] = true;
890897

891-
$timeout(function() {
898+
$timeout(function onUpdateHistoryTimeout() {
892899
self.updateLocalTxHistory(fc, function(err) {
893900
self.updatingTxHistory[walletId] = false;
894901
if (err)

src/js/services/profileService.js

Lines changed: 2 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -2,6 +2,7 @@
22

33
var walletDefinedByKeys = require('byteballcore/wallet_defined_by_keys.js');
44
var device = require('byteballcore/device.js');
5+
var breadcrumbs = require('byteballcore/breadcrumbs.js');
56

67
angular.module('copayApp.services')
78
.factory('profileService', function profileServiceFactory($rootScope, $location, $timeout, $filter, $log, lodash, storageService, bwcService, configService, pushNotificationsService, isCordova, gettext, gettextCatalog, nodeWebkit, uxLanguage) {
@@ -311,6 +312,7 @@ angular.module('copayApp.services')
311312
else $log.debug('Unsubscribed from push notifications service');
312313
});*/
313314
$log.debug('Deleting Wallet:', fc.credentials.walletName);
315+
breadcrumbs.add('Deleting Wallet: ' + fc.credentials.walletName);
314316

315317
root.profile.credentials = lodash.reject(root.profile.credentials, {
316318
walletId: walletId

0 commit comments

Comments
 (0)