Skip to content

Commit

Permalink
fix
Browse files Browse the repository at this point in the history
  • Loading branch information
pauldambra committed Mar 21, 2024
1 parent c015b4a commit 3c45e4d
Show file tree
Hide file tree
Showing 3 changed files with 7 additions and 4 deletions.
1 change: 0 additions & 1 deletion cypress/e2e/session-recording.cy.ts
Original file line number Diff line number Diff line change
Expand Up @@ -102,7 +102,6 @@ describe('Session recording', () => {
},
})

cy.posthog().invoke('on', 'network_capture_ready', onNetworkReadyStub)
cy.wait('@recorder')
})

Expand Down
4 changes: 3 additions & 1 deletion src/extensions/replay/sessionrecording.ts
Original file line number Diff line number Diff line change
Expand Up @@ -18,7 +18,7 @@ import { PostHog } from '../../posthog-core'
import { DecideResponse, FlagVariant, NetworkRecordOptions, NetworkRequest, Properties } from '../../types'
import { EventType, type eventWithTime, type listenerHandler, RecordPlugin } from '@rrweb/types'
import Config from '../../config'
import { _timestamp, loadScript } from '../../utils'
import { _each, _timestamp, loadScript } from '../../utils'

import {
_isBoolean,
Expand Down Expand Up @@ -655,6 +655,8 @@ export class SessionRecording {
this._tryAddCustomEvent('$posthog_config', {
config: this.instance.config,
})

_each(this._sessionReplayReadyHandlers, (handler) => handler())
}

private _scheduleFullSnapshot(): void {
Expand Down
6 changes: 4 additions & 2 deletions src/loader-recorder.ts
Original file line number Diff line number Diff line change
Expand Up @@ -78,6 +78,10 @@ export function patch(
enumerable: false,
value: original,
},
__posthog_wrapped__: {
enumerable: false,
value: true,
},
})
}

Expand Down Expand Up @@ -565,8 +569,6 @@ function initNetworkObserver(
fetchObserver = initFetchObserver(cb, win, networkOptions)
}

options.eventEmitter?.emit('network_capture_ready')

return () => {
performanceObserver()
xhrObserver()
Expand Down

0 comments on commit 3c45e4d

Please sign in to comment.