Skip to content

Commit

Permalink
only delete replay tests, more debugging
Browse files Browse the repository at this point in the history
  • Loading branch information
billyvg committed Feb 28, 2023
1 parent 8092f21 commit e3edf79
Show file tree
Hide file tree
Showing 3 changed files with 10 additions and 10 deletions.
8 changes: 3 additions & 5 deletions packages/integration-tests/suites/replay/privacyInput/test.ts
Original file line number Diff line number Diff line change
Expand Up @@ -40,13 +40,11 @@ sentryTest('should mask input initial value and its changes', async ({ getLocalT
const text = 'test';

page.on('console', message => console.log(message.text()))
const input = page.locator('#input');
await input.press('t')
await input.press('e')
await input.press('s')
await input.press('t')
await page.locator('#input').type(text);
console.log('input value: ', await page.locator('#input').inputValue());
console.log('before force flush', new Date().getTime())
await forceFlushReplay();
console.log('after force flush', new Date().getTime())
const allSnapshots = getIncrementalRecordingSnapshots(await reqPromise1);
const snapshots = allSnapshots.filter(isInputMutation);
const lastSnapshot = snapshots[snapshots.length - 1];
Expand Down
3 changes: 0 additions & 3 deletions packages/replay/src/coreHandlers/handleScope.ts
Original file line number Diff line number Diff line change
Expand Up @@ -48,8 +48,5 @@ export function handleScope(scope: Scope): Breadcrumb | null {
return null;
}

// eslint-disable-next-line
console.log({newBreadcrumb})

return createBreadcrumb(newBreadcrumb);
}
9 changes: 7 additions & 2 deletions packages/replay/src/replay.ts
Original file line number Diff line number Diff line change
@@ -1,5 +1,5 @@
/* eslint-disable max-lines */ // TODO: We might want to split this file up
import { EventType, record } from '@sentry-internal/rrweb';
import { EventType, IncrementalSource, record } from '@sentry-internal/rrweb';
import { captureException, getCurrentHub } from '@sentry/core';
import type { Breadcrumb, ReplayRecordingMode } from '@sentry/types';
import { logger } from '@sentry/utils';
Expand Down Expand Up @@ -203,6 +203,7 @@ export class ReplayContainer implements ReplayContainerInterface {
// Without this, it would record forever, until an error happens, which we don't want
// instead, we'll always keep the last 60 seconds of replay before an error happened
...(this.recordingMode === 'error' && { checkoutEveryNms: ERROR_CHECKOUT_TIME }),
recordCrossOriginIframes: true,
emit: this._handleRecordingEmit,
});
} catch (err) {
Expand Down Expand Up @@ -528,6 +529,10 @@ export class ReplayContainer implements ReplayContainerInterface {
return;
}

if (event.type === EventType.IncrementalSnapshot && event.data.source === IncrementalSource.Input) {
console.log(JSON.stringify(event));
}

this.addUpdate(() => {
// The session is always started immediately on pageload/init, but for
// error-only replays, it should reflect the most recent checkout
Expand Down Expand Up @@ -795,7 +800,7 @@ export class ReplayContainer implements ReplayContainerInterface {
// Note this empties the event buffer regardless of outcome of sending replay
const recordingData = await this.eventBuffer.finish();

console.log('RUNNING FLUSH')
console.log('RUNNING FLUSH', new Date().getTime())
// NOTE: Copy values from instance members, as it's possible they could
// change before the flush finishes.
const replayId = this.session.id;
Expand Down

0 comments on commit e3edf79

Please sign in to comment.