Skip to content

Commit

Permalink
fix it??
Browse files Browse the repository at this point in the history
  • Loading branch information
mydea committed Aug 10, 2023
1 parent 26cb98b commit dc1b624
Show file tree
Hide file tree
Showing 2 changed files with 7 additions and 13 deletions.
Original file line number Diff line number Diff line change
Expand Up @@ -8,7 +8,7 @@ import {
REPLAY_DEFAULT_FLUSH_MAX_DELAY,
shouldSkipReplayTest,
waitForReplayRequest,
replayEnvelopeParser,
getDecompressedRecordingEvents,
} from '../../../utils/replayHelpers';

sentryTest(
Expand Down Expand Up @@ -40,17 +40,11 @@ sentryTest(

// We only want to count replays here
if (event && isReplayEvent(event)) {
called++;
}

// TODO FN: Just for debugging....
if (called > 0) {
// eslint-disable-next-line no-console
console.log(event);

const recordingEvents = replayEnvelopeParser(route.request());
// eslint-disable-next-line no-console
console.log(JSON.stringify(recordingEvents, null, 2));
const events = getDecompressedRecordingEvents(route.request());
// this makes sure we ignore e.g. mouse move events which can otherwise lead to flakes
if (events.length > 0) {
called++;
}
}

return route.fulfill({
Expand Down
2 changes: 1 addition & 1 deletion packages/browser-integration-tests/utils/replayHelpers.ts
Original file line number Diff line number Diff line change
Expand Up @@ -267,7 +267,7 @@ function getOptionsEvents(replayRequest: Request): CustomRecordingEvent[] {
return getAllCustomRrwebRecordingEvents(events).filter(data => data.tag === 'options');
}

function getDecompressedRecordingEvents(resOrReq: Request | Response): RecordingSnapshot[] {
export function getDecompressedRecordingEvents(resOrReq: Request | Response): RecordingSnapshot[] {
const replayRequest = getRequest(resOrReq);
return (
(replayEnvelopeRequestParser(replayRequest, 5) as eventWithTime[])
Expand Down

0 comments on commit dc1b624

Please sign in to comment.