1. Crash Details such as Company Name and Crashpad URL are now being fetched from the global config file.

This commit is contained in:
Vikas Shashidhar 2017-06-05 16:09:31 +05:30 committed by Vikas Shashidhar
parent 65b08f0952
commit abdd8da1fa
5 changed files with 29 additions and 13 deletions

View File

@ -1,6 +1,10 @@
{
"url": "https://foundation-dev.symphony.com",
"sendCrashReports": true,
"crashReporterDetails": {
"backendURL": "http://crash.symphony.com/",
"sendCrashReports": true,
"autoSubmit": true
},
"minimizeOnClose" : true,
"launchOnStartup" : true
}

View File

@ -1,24 +1,31 @@
'use strict';
const electron = require('electron');
const {crashReporter} = require('electron');
const {app} = process.type === 'browser' ? electron : electron.remote;
/**
* Setup the crash reporter with appropriate information
* @param sendCrashReports: An object to get crash information
* @param crashReporterDetails: An object to get crash information
* from the global config file
* @param detailObj: An object to send extra parameters
* via the crash reporter
*/
function setupCrashReporter(detailObj, sendCrashReports) {
// Will eventually have to fetch all these from the config file.
let crashReportInfo = {
companyName: "Symphony Communication Services, LLC",
submitURL: "http://crash.symphony.com",
autoSubmit: true,
uploadToServer: sendCrashReports,
extra: detailObj
function setupCrashReporter(detailObj, crashReporterDetails) {
// Fetch details from config file
if (!crashReporterDetails){
return
}
let crashReportInfo = {
companyName: app.getName(),
submitURL: crashReporterDetails.backendURL,
autoSubmit: crashReporterDetails.autoSubmit,
uploadToServer: crashReporterDetails.sendCrashReports,
extra: detailObj
};
// App store builds cannot use crash reporter, so, return if that's the case
if (process.platform === 'darwin' && process.mas) {
return

View File

@ -167,7 +167,7 @@ function createWin(urlFromConfig) {
* Get crash info from global config and setup crash reporter for Main Process.
*/
function initializeCrashReporter () {
getConfigField('sendCrashReports').then(
getConfigField('crashReporterDetails').then(
function (data) {
crashReporter.setupCrashReporter({'window': 'main'}, data);
}

View File

@ -34,7 +34,12 @@ const throttledSetBadgeCount = throttle(1000, function(count) {
});
// Setup the crash reporter
crashReporter.setupCrashReporter({'window': 'preloadMain'});
var demoData = {
"backendURL": "http://localhost:1127/post",
"sendCrashReports": true,
"autoSubmit": true
};
crashReporter.setupCrashReporter({'window': 'preloadMain'}, demoData);
createAPI();

View File

@ -75,7 +75,7 @@ function doCreateMainWindow(initialUrl, initialBounds) {
/**
* Get crash info from global config and setup crash reporter.
*/
getConfigField('sendCrashReports').then(
getConfigField('crashReporterDetails').then(
function (data) {
crashReporter.setupCrashReporter({'window': 'main'}, data);
}