|
@@ -196,19 +196,30 @@ ifdescribe(!isLinuxOnArm && !process.mas && !process.env.DISABLE_CRASH_REPORTER_
|
|
|
});
|
|
|
|
|
|
ifdescribe(!isLinuxOnArm)('extra parameter limits', () => {
|
|
|
- it('should truncate extra values longer than 127 characters', async () => {
|
|
|
+ function stitchLongCrashParam (crash: any, paramKey: string) {
|
|
|
+ if (crash[paramKey]) return crash[paramKey];
|
|
|
+ let chunk = 1;
|
|
|
+ let stitched = '';
|
|
|
+ while (crash[`${paramKey}__${chunk}`]) {
|
|
|
+ stitched += crash[`${paramKey}__${chunk}`];
|
|
|
+ chunk++;
|
|
|
+ }
|
|
|
+ return stitched;
|
|
|
+ }
|
|
|
+
|
|
|
+ it('should truncate extra values longer than 5 * 4096 characters', async () => {
|
|
|
const { port, waitForCrash } = await startServer();
|
|
|
const { remotely } = await startRemoteControlApp();
|
|
|
remotely((port: number) => {
|
|
|
require('electron').crashReporter.start({
|
|
|
submitURL: `http://127.0.0.1:${port}`,
|
|
|
ignoreSystemCrashHandler: true,
|
|
|
- extra: { longParam: 'a'.repeat(130) }
|
|
|
+ extra: { longParam: 'a'.repeat(100000) }
|
|
|
});
|
|
|
setTimeout(() => process.crash());
|
|
|
}, port);
|
|
|
const crash = await waitForCrash();
|
|
|
- expect(crash).to.have.property('longParam', 'a'.repeat(127));
|
|
|
+ expect(stitchLongCrashParam(crash, 'longParam')).to.have.lengthOf(160 * 127, 'crash should have truncated longParam');
|
|
|
});
|
|
|
|
|
|
it('should omit extra keys with names longer than the maximum', async () => {
|