Skip to content

Commit 28144ca

Browse files
committed
👌 Add comment on endViewId flow
1 parent 0cbe672 commit 28144ca

1 file changed

Lines changed: 2 additions & 1 deletion

File tree

‎packages/browser-rum-core/src/domain/resource/webSocketCollection.ts‎

Lines changed: 2 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -237,7 +237,8 @@ function buildCompletedEvent(
237237
const endClocks = endInfo.at
238238
const endViewId =
239239
trackingEndReason === 'session_end'
240-
? viewHistory.findView(endClocks.relative, { returnInactive: true })?.id
240+
? // On session_end, the websocket event can be received after the active view has been closed.
241+
viewHistory.findView(endClocks.relative, { returnInactive: true })?.id
241242
: viewHistory.findView(endClocks.relative)?.id
242243
const inboundIdleDurationBeforeClose =
243244
webSocket.lastMessageInAt !== undefined ? elapsed(webSocket.lastMessageInAt, endClocks.timeStamp) : undefined

0 commit comments

Comments
 (0)