From 87c25e7f12f38a0e3ca0e8a76a05da6c47caaa4b Mon Sep 17 00:00:00 2001 From: Bobby Galli Date: Mon, 11 Mar 2024 19:29:45 -0400 Subject: [PATCH] fix: add stackKey to CrashDetails (#119) --- spec/fakes/crash/crash-api-response.ts | 1 + src/crash/crash-details/crash-details.ts | 3 +++ 2 files changed, 4 insertions(+) diff --git a/spec/fakes/crash/crash-api-response.ts b/spec/fakes/crash/crash-api-response.ts index 84460c4..b5ef4af 100644 --- a/spec/fakes/crash/crash-api-response.ts +++ b/spec/fakes/crash/crash-api-response.ts @@ -26,6 +26,7 @@ export const createFakeCrashApiResponse = () => ({ platform: 'NES', previousCrashId: 998, processor: 'Pentium 4', + stackKey: 'myConsoleCrasher(1337)', stackKeyComment: 'hello world!', stackKeyId: 117, stackKeyDefectLabel: 'idk', diff --git a/src/crash/crash-details/crash-details.ts b/src/crash/crash-details/crash-details.ts index 1d4fe82..5f14fa1 100644 --- a/src/crash/crash-details/crash-details.ts +++ b/src/crash/crash-details/crash-details.ts @@ -46,6 +46,7 @@ export interface CrashDetails { platform: string; previousCrashId: number; processor: string; + stackKey: string; stackKeyComment: string; stackKeyId: number; stackKeyDefectId: number; @@ -79,6 +80,7 @@ export function createCrashDetails(options: CrashDetailsRawResponse): CrashDetai const ipAddress = defaultToEmptyString(options.ipAddress, 'options.ipAddress'); const platform = defaultToEmptyString(options.platform, 'options.platform'); const processor = defaultToEmptyString(options.processor, 'options.processor'); + const stackKey = defaultToEmptyString(options.stackKey, 'options.stackKey'); const stackKeyComment = defaultToEmptyString(options.stackKeyComment,'options.stackKeyComment'); const stackKeyDefectLabel = defaultToEmptyString(options.stackKeyDefectLabel, 'options.stackKeyDefectLabel'); const stackKeyDefectUrl = defaultToEmptyString(options.stackKeyDefectUrl, 'options.stackKeyDefectUrl'); @@ -114,6 +116,7 @@ export function createCrashDetails(options: CrashDetailsRawResponse): CrashDetai ipAddress, platform, processor, + stackKey, stackKeyComment, stackKeyDefectLabel, stackKeyDefectUrl,