Skip to content

Commit a2277de

Browse files
committed
feat(core): Add replay_event type for events
1 parent 33fd2d6 commit a2277de

File tree

3 files changed

+4
-7
lines changed

3 files changed

+4
-7
lines changed

packages/core/src/hub.ts

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -233,7 +233,7 @@ export class Hub implements HubInterface {
233233
*/
234234
public captureEvent(event: Event, hint?: EventHint): string {
235235
const eventId = hint && hint.event_id ? hint.event_id : uuid4();
236-
if (event.type !== 'transaction') {
236+
if (!event.type) {
237237
this._lastEventId = eventId;
238238
}
239239

packages/replay/src/replay.ts

Lines changed: 2 additions & 5 deletions
Original file line numberDiff line numberDiff line change
@@ -422,18 +422,15 @@ export class ReplayContainer {
422422
**/
423423
handleGlobalEvent: (event: Event) => Event = (event: Event) => {
424424
// Do not apply replayId to the root event
425-
if (
426-
// @ts-ignore new event type
427-
event.type === REPLAY_EVENT_NAME
428-
) {
425+
if (event.type === REPLAY_EVENT_NAME) {
429426
// Replays have separate set of breadcrumbs, do not include breadcrumbs
430427
// from core SDK
431428
delete event.breadcrumbs;
432429
return event;
433430
}
434431

435432
// Only tag transactions with replayId if not waiting for an error
436-
if (event.type !== 'transaction' || !this._waitForError) {
433+
if (!event.type || !this._waitForError) {
437434
event.tags = { ...event.tags, replayId: this.session?.id };
438435
}
439436

packages/types/src/event.ts

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -55,7 +55,7 @@ export interface Event {
5555
}
5656

5757
/** JSDoc */
58-
export type EventType = 'transaction';
58+
export type EventType = 'transaction' | 'replay_event';
5959

6060
/** JSDoc */
6161
export interface EventHint {

0 commit comments

Comments
 (0)