Add tentative prefix to crash report uploads
This commit is contained in:
parent
90356d4c0f
commit
145d9287d9
3 changed files with 11 additions and 2 deletions
|
@ -106,6 +106,7 @@ export function setup(getLogger: () => LoggerType): void {
|
||||||
extension: 'dmp',
|
extension: 'dmp',
|
||||||
contentType: 'application/octet-stream',
|
contentType: 'application/octet-stream',
|
||||||
compress: false,
|
compress: false,
|
||||||
|
prefix: 'desktop-crash-',
|
||||||
});
|
});
|
||||||
|
|
||||||
logger.info('crashReports: upload complete');
|
logger.info('crashReports: upload complete');
|
||||||
|
|
|
@ -46,6 +46,7 @@ export type UploadOptionsType = Readonly<{
|
||||||
extension?: string;
|
extension?: string;
|
||||||
contentType?: string;
|
contentType?: string;
|
||||||
compress?: boolean;
|
compress?: boolean;
|
||||||
|
prefix?: string;
|
||||||
}>;
|
}>;
|
||||||
|
|
||||||
export const upload = async ({
|
export const upload = async ({
|
||||||
|
@ -55,10 +56,17 @@ export const upload = async ({
|
||||||
extension = 'gz',
|
extension = 'gz',
|
||||||
contentType = 'application/gzip',
|
contentType = 'application/gzip',
|
||||||
compress = true,
|
compress = true,
|
||||||
|
prefix,
|
||||||
}: UploadOptionsType): Promise<string> => {
|
}: UploadOptionsType): Promise<string> => {
|
||||||
const headers = { 'User-Agent': getUserAgent(appVersion) };
|
const headers = { 'User-Agent': getUserAgent(appVersion) };
|
||||||
|
|
||||||
const signedForm = await got.get(BASE_URL, {
|
const formUrl = new URL(BASE_URL);
|
||||||
|
|
||||||
|
if (prefix !== undefined) {
|
||||||
|
formUrl.searchParams.set('prefix', prefix);
|
||||||
|
}
|
||||||
|
|
||||||
|
const signedForm = await got.get(formUrl.toString(), {
|
||||||
responseType: 'json',
|
responseType: 'json',
|
||||||
headers,
|
headers,
|
||||||
timeout: UPLOAD_TIMEOUT,
|
timeout: UPLOAD_TIMEOUT,
|
||||||
|
|
|
@ -46,7 +46,7 @@ describe('upload', () => {
|
||||||
);
|
);
|
||||||
|
|
||||||
sinon.assert.calledOnce(this.fakeGet);
|
sinon.assert.calledOnce(this.fakeGet);
|
||||||
sinon.assert.calledWith(this.fakeGet, 'https://debuglogs.org', {
|
sinon.assert.calledWith(this.fakeGet, 'https://debuglogs.org/', {
|
||||||
responseType: 'json',
|
responseType: 'json',
|
||||||
headers: { 'User-Agent': 'Signal-Desktop/1.2.3 Linux' },
|
headers: { 'User-Agent': 'Signal-Desktop/1.2.3 Linux' },
|
||||||
timeout: { request: durations.MINUTE },
|
timeout: { request: durations.MINUTE },
|
||||||
|
|
Loading…
Reference in a new issue