Skip to content

Commit

Permalink
fix: post with crashTypeId (#117)
Browse files Browse the repository at this point in the history
  • Loading branch information
bobbyg603 authored Jan 19, 2024
1 parent 27d44bf commit 737e2c3
Show file tree
Hide file tree
Showing 3 changed files with 10 additions and 5 deletions.
3 changes: 2 additions & 1 deletion src/post/crash-post-client.spec.ts
Original file line number Diff line number Diff line change
Expand Up @@ -76,7 +76,8 @@ describe('CrashPostClient', () => {
expect(fakeFormData.append).toHaveBeenCalledWith('database', database);
expect(fakeFormData.append).toHaveBeenCalledWith('appName', application);
expect(fakeFormData.append).toHaveBeenCalledWith('appVersion', version);
expect(fakeFormData.append).toHaveBeenCalledWith('crashType', type);
expect(fakeFormData.append).toHaveBeenCalledWith('crashType', type.name);
expect(fakeFormData.append).toHaveBeenCalledWith('crashTypeId', `${type.id}`);
expect(fakeFormData.append).toHaveBeenCalledWith('s3key', url);
expect(fakeFormData.append).toHaveBeenCalledWith('md5', md5);
expect(bugsplatApiClient.fetch).toHaveBeenCalledWith(
Expand Down
3 changes: 2 additions & 1 deletion src/post/crash-post-client.ts
Original file line number Diff line number Diff line change
Expand Up @@ -83,7 +83,8 @@ export class CrashPostClient {
formData.append('database', database);
formData.append('appName', application);
formData.append('appVersion', version);
formData.append('crashType', crashType);
formData.append('crashType', crashType.name);
formData.append('crashTypeId', `${crashType.id}`);
formData.append('s3key', s3Key);
formData.append('md5', md5);

Expand Down
9 changes: 6 additions & 3 deletions src/post/crash-type.ts
Original file line number Diff line number Diff line change
@@ -1,4 +1,7 @@
export enum CrashType {
native = 'Windows.Native',
dotnet = 'Windows.NET'
export class CrashType {
static readonly crashpad = new CrashType('Crashpad', 5);
static readonly dotnet = new CrashType('Windows.NET', 8);
static readonly electron = new CrashType('Electron', 22);
static readonly native = new CrashType('Windows.Native', 1);
private constructor(public readonly name: string, public readonly id: number) { }
}

0 comments on commit 737e2c3

Please sign in to comment.