Browse Source

feat: [crashReporter] enable compression by default (#25288)

Jeremy Rose 4 years ago
parent
commit
4dc09ea9dc

+ 1 - 1
docs/api/crash-reporter.md

@@ -59,7 +59,7 @@ The `crashReporter` module has the following methods:
   * `rateLimit` Boolean (optional) _macOS_ _Windows_ - If true, limit the
     number of crashes uploaded to 1/hour. Default is `false`.
   * `compress` Boolean (optional) - If true, crash reports will be compressed
-    and uploaded with `Content-Encoding: gzip`. Default is `false`.
+    and uploaded with `Content-Encoding: gzip`. Default is `true`.
   * `extra` Record<String, String> (optional) - Extra string key/value
     annotations that will be sent along with crash reports that are generated
     in the main process. Only string values are supported. Crashes generated in

+ 1 - 1
lib/browser/api/crash-reporter.ts

@@ -13,7 +13,7 @@ class CrashReporter {
       submitURL,
       uploadToServer = true,
       rateLimit = false,
-      compress = false
+      compress = true
     } = options || {};
 
     if (submitURL == null) throw new Error('submitURL is a required option to crashReporter.start');

+ 4 - 0
spec-main/api-crash-reporter-spec.ts

@@ -232,6 +232,7 @@ ifdescribe(!isLinuxOnArm && !process.mas && !process.env.DISABLE_CRASH_REPORTER_
         await remotely((port: number) => {
           require('electron').crashReporter.start({
             submitURL: `http://127.0.0.1:${port}`,
+            compress: false,
             ignoreSystemCrashHandler: true
           });
         }, [port]);
@@ -271,6 +272,7 @@ ifdescribe(!isLinuxOnArm && !process.mas && !process.env.DISABLE_CRASH_REPORTER_
       remotely((port: number) => {
         require('electron').crashReporter.start({
           submitURL: `http://127.0.0.1:${port}`,
+          compress: false,
           ignoreSystemCrashHandler: true,
           extra: { longParam: 'a'.repeat(100000) }
         });
@@ -287,6 +289,7 @@ ifdescribe(!isLinuxOnArm && !process.mas && !process.env.DISABLE_CRASH_REPORTER_
       remotely((port: number, kKeyLengthMax: number) => {
         require('electron').crashReporter.start({
           submitURL: `http://127.0.0.1:${port}`,
+          compress: false,
           ignoreSystemCrashHandler: true,
           extra: {
             ['a'.repeat(kKeyLengthMax + 10)]: 'value',
@@ -399,6 +402,7 @@ ifdescribe(!isLinuxOnArm && !process.mas && !process.env.DISABLE_CRASH_REPORTER_
       await remotely((port: number) => {
         require('electron').crashReporter.start({
           submitURL: `http://127.0.0.1:${port}`,
+          compress: false,
           ignoreSystemCrashHandler: true
         });
       }, [port]);

+ 1 - 0
spec-main/fixtures/apps/crash/main.js

@@ -12,6 +12,7 @@ const addGlobalParam = app.commandLine.getSwitchValue('add-global-param')?.split
 crashReporter.start({
   productName: 'Zombies',
   companyName: 'Umbrella Corporation',
+  compress: false,
   uploadToServer,
   submitURL: url,
   ignoreSystemCrashHandler: true,

+ 1 - 0
spec-main/fixtures/apps/crash/node-crash.js

@@ -2,6 +2,7 @@ if (process.platform === 'linux') {
   process.crashReporter.start({
     submitURL: process.argv[2],
     productName: 'Zombies',
+    compress: false,
     globalExtra: {
       _version: process.argv[3]
     }