Skip to content

Commit 98339cb

Browse files
authored
Decode Failures if custom FailureConverter configured (#2822)
* Add check for encodedAttributes and decode them if they exist. Key off of attempt number to get latest failure * Remove inspect * Remove key
1 parent 3c994f7 commit 98339cb

File tree

1 file changed

+27
-8
lines changed

1 file changed

+27
-8
lines changed

src/lib/components/workflow/pending-activity/pending-activity-card.svelte

Lines changed: 27 additions & 8 deletions
Original file line numberDiff line numberDiff line change
@@ -16,6 +16,7 @@
1616
import { workflowRun } from '$lib/stores/workflow-run';
1717
import type { PendingActivity } from '$lib/types/events';
1818
import { activityCommandsEnabled } from '$lib/utilities/activity-commands-enabled';
19+
import { type PotentiallyDecodable } from '$lib/utilities/decode-payload';
1920
import { formatDate } from '$lib/utilities/format-date';
2021
import {
2122
formatAttemptsLeft,
@@ -188,14 +189,32 @@
188189
<p class="text-sm text-secondary/80">
189190
{translate('workflows.last-failure')}
190191
</p>
191-
<CodeBlock
192-
content={stringifyWithBigInt(
193-
omit(activity.lastFailure, 'stackTrace'),
194-
)}
195-
maxHeight={384}
196-
copyIconTitle={translate('common.copy-icon-title')}
197-
copySuccessIconTitle={translate('common.copy-success-icon-title')}
198-
/>
192+
{#if activity.lastFailure?.encodedAttributes}
193+
{#key activity.attempt}
194+
<PayloadDecoder
195+
value={activity.lastFailure as PotentiallyDecodable}
196+
let:decodedValue
197+
>
198+
<CodeBlock
199+
content={decodedValue}
200+
maxHeight={384}
201+
copyIconTitle={translate('common.copy-icon-title')}
202+
copySuccessIconTitle={translate(
203+
'common.copy-success-icon-title',
204+
)}
205+
/>
206+
</PayloadDecoder>
207+
{/key}
208+
{:else}
209+
<CodeBlock
210+
content={stringifyWithBigInt(
211+
omit(activity.lastFailure, 'stackTrace'),
212+
)}
213+
maxHeight={384}
214+
copyIconTitle={translate('common.copy-icon-title')}
215+
copySuccessIconTitle={translate('common.copy-success-icon-title')}
216+
/>
217+
{/if}
199218
{/if}
200219
</div>
201220
{#if activity.lastFailure?.stackTrace}

0 commit comments

Comments
 (0)