Skip to content

Commit a739e63

Browse files
Litarnusandrewshie-sentry
authored andcommitted
feat(outcomes): add invalid signature as discard reason (#93425)
This PR introduces a new discard reason that will be shown in the UI: `Invalid Signature`. ref RELAY-17 See: getsentry/relay#4772
1 parent eadc20f commit a739e63

File tree

2 files changed

+11
-0
lines changed

2 files changed

+11
-0
lines changed

static/app/views/organizationStats/getReasonGroupName.spec.ts

Lines changed: 8 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -108,4 +108,12 @@ describe('getReasonGroupName', function () {
108108
expect(getReasonGroupName(Outcome.FILTERED, input)).toBe(expected);
109109
});
110110
});
111+
it('handles invalid signature types', function () {
112+
expect(getReasonGroupName(Outcome.INVALID, 'invalid_signature')).toBe(
113+
'invalid_signature'
114+
);
115+
expect(getReasonGroupName(Outcome.INVALID, 'missing_signature')).toBe(
116+
'invalid_signature'
117+
);
118+
});
111119
});

static/app/views/organizationStats/getReasonGroupName.ts

Lines changed: 3 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -24,6 +24,8 @@ enum DiscardReason {
2424
INVALID_REPLAY_VIDEO = 'invalid_replay_video',
2525
PAYLOAD = 'payload',
2626
INVALID_COMPRESSION = 'invalid_compression',
27+
INVALID_SIGNATURE = 'invalid_signature',
28+
MISSING_SIGNATURE = 'missing_signature',
2729
TOO_LARGE = 'too_large', // Left for backwards compatibility
2830
// All the too_large we want to communicate to the end-user
2931
TOO_LARGE_EVENT = 'too_large:event',
@@ -115,6 +117,7 @@ const invalidReasonsGroup: Record<string, DiscardReason[]> = {
115117
DiscardReason.INVALID_REPLAY_RECORDING,
116118
DiscardReason.INVALID_REPLAY_VIDEO,
117119
],
120+
invalid_signature: [DiscardReason.INVALID_SIGNATURE, DiscardReason.MISSING_SIGNATURE],
118121
payload: [DiscardReason.PAYLOAD, DiscardReason.INVALID_COMPRESSION],
119122
too_large_other: [DiscardReason.TOO_LARGE],
120123
too_large_event: [DiscardReason.TOO_LARGE_EVENT],

0 commit comments

Comments
 (0)