From 8de06f0c571bc24e4230063e3ef0428390df773e Mon Sep 17 00:00:00 2001 From: Jeremy Apthorp Date: Tue, 19 May 2020 13:47:21 -0700 Subject: [PATCH] feat: deprecate uncompressed crash uploads (#23598) --- docs/breaking-changes.md | 17 +++++++++++++++++ lib/browser/api/crash-reporter.ts | 6 +++++- 2 files changed, 22 insertions(+), 1 deletion(-) diff --git a/docs/breaking-changes.md b/docs/breaking-changes.md index 6323aa03b479..d5bb629de067 100644 --- a/docs/breaking-changes.md +++ b/docs/breaking-changes.md @@ -30,6 +30,17 @@ They should be called only from the main process. See [#23265](https://github.com/electron/electron/pull/23265) for more details. +### Default Changed: `crashReporter.start({ compress: true })` + +The default value of the `compress` option to `crashReporter.start` has changed +from `false` to `true`. This means that crash dumps will be uploaded to the +crash ingestion server with the `Content-Encoding: gzip` header, and the body +will be compressed. + +If your crash ingestion server does not support compressed payloads, you can +turn off compression by specifying `{ compress: false }` in the crash reporter +options. + ## Planned Breaking API Changes (11.0) There are no breaking changes planned for 11.0. @@ -81,6 +92,12 @@ All above methods remain non-deprecated when called from the main process. See [#23265](https://github.com/electron/electron/pull/23265) for more details. +### Deprecated: `crashReporter.start({ compress: false })` + +Setting `{ compress: false }` in `crashReporter.start` is deprecated. Nearly +all crash ingestion servers support gzip compression. This option will be +removed in a future version of Electron. + ### Removed: Browser Window Affinity The `affinity` option when constructing a new `BrowserWindow` will be removed diff --git a/lib/browser/api/crash-reporter.ts b/lib/browser/api/crash-reporter.ts index 2d1164140189..0cf765ae3633 100644 --- a/lib/browser/api/crash-reporter.ts +++ b/lib/browser/api/crash-reporter.ts @@ -1,4 +1,4 @@ -import { app } from 'electron'; +import { app, deprecate } from 'electron'; const binding = process.electronBinding('crash_reporter'); @@ -18,6 +18,10 @@ class CrashReporter { if (submitURL == null) throw new Error('submitURL is a required option to crashReporter.start'); + if (!compress) { + deprecate.log('Sending uncompressed crash reports is deprecated and will be removed in a future version of Electron. Set { compress: true } to opt-in to the new behavior. Crash reports will be uploaded gzipped, which most crash reporting servers support.'); + } + const appVersion = app.getVersion(); if (companyName && globalExtra._companyName == null) globalExtra._companyName = companyName;