diff --git a/backend/pkg/messages/messages.go b/backend/pkg/messages/messages.go index 4fb53be08..bde18cc58 100644 --- a/backend/pkg/messages/messages.go +++ b/backend/pkg/messages/messages.go @@ -48,7 +48,7 @@ const ( MsgPerformanceTrack = 49 MsgStringDict = 50 MsgSetNodeAttributeDict = 51 - MsgResourceTimingLegacy = 53 + MsgResourceTimingDeprecated = 53 MsgConnectionInformation = 54 MsgSetPageVisibility = 55 MsgPerformanceTrackAggr = 56 @@ -1297,7 +1297,7 @@ func (msg *SetNodeAttributeDict) TypeID() int { return 51 } -type ResourceTimingLegacy struct { +type ResourceTimingDeprecated struct { message Timestamp uint64 Duration uint64 @@ -1309,7 +1309,7 @@ type ResourceTimingLegacy struct { Initiator string } -func (msg *ResourceTimingLegacy) Encode() []byte { +func (msg *ResourceTimingDeprecated) Encode() []byte { buf := make([]byte, 81+len(msg.URL)+len(msg.Initiator)) buf[0] = 53 p := 1 @@ -1324,11 +1324,11 @@ func (msg *ResourceTimingLegacy) Encode() []byte { return buf[:p] } -func (msg *ResourceTimingLegacy) Decode() Message { +func (msg *ResourceTimingDeprecated) Decode() Message { return msg } -func (msg *ResourceTimingLegacy) TypeID() int { +func (msg *ResourceTimingDeprecated) TypeID() int { return 53 } diff --git a/backend/pkg/messages/read-message.go b/backend/pkg/messages/read-message.go index adb80d2ed..888fee077 100644 --- a/backend/pkg/messages/read-message.go +++ b/backend/pkg/messages/read-message.go @@ -756,9 +756,9 @@ func DecodeSetNodeAttributeDict(reader BytesReader) (Message, error) { return msg, err } -func DecodeResourceTimingLegacy(reader BytesReader) (Message, error) { +func DecodeResourceTimingDeprecated(reader BytesReader) (Message, error) { var err error = nil - msg := &ResourceTimingLegacy{} + msg := &ResourceTimingDeprecated{} if msg.Timestamp, err = reader.ReadUint(); err != nil { return nil, err } @@ -1895,7 +1895,7 @@ func ReadMessage(t uint64, reader BytesReader) (Message, error) { case 51: return DecodeSetNodeAttributeDict(reader) case 53: - return DecodeResourceTimingLegacy(reader) + return DecodeResourceTimingDeprecated(reader) case 54: return DecodeConnectionInformation(reader) case 55: diff --git a/ee/connectors/msgcodec/messages.py b/ee/connectors/msgcodec/messages.py index 4e384cb03..63074d920 100644 --- a/ee/connectors/msgcodec/messages.py +++ b/ee/connectors/msgcodec/messages.py @@ -441,7 +441,7 @@ class SetNodeAttributeDict(Message): self.value_key = value_key -class ResourceTimingLegacy(Message): +class ResourceTimingDeprecated(Message): __id__ = 53 def __init__(self, timestamp, duration, ttfb, header_size, encoded_body_size, decoded_body_size, url, initiator): diff --git a/ee/connectors/msgcodec/msgcodec.py b/ee/connectors/msgcodec/msgcodec.py index d4af91836..773dc4eb7 100644 --- a/ee/connectors/msgcodec/msgcodec.py +++ b/ee/connectors/msgcodec/msgcodec.py @@ -420,7 +420,7 @@ class MessageCodec(Codec): ) if message_id == 53: - return ResourceTimingLegacy( + return ResourceTimingDeprecated( timestamp=self.read_uint(reader), duration=self.read_uint(reader), ttfb=self.read_uint(reader), diff --git a/frontend/app/components/Session/WebPlayer.tsx b/frontend/app/components/Session/WebPlayer.tsx index 8111f11af..509add261 100644 --- a/frontend/app/components/Session/WebPlayer.tsx +++ b/frontend/app/components/Session/WebPlayer.tsx @@ -68,7 +68,7 @@ function WebPlayer(props: any) { if (session.events.length > 0 || session.errors.length > 0) { contextValue.player?.updateLists?.(session) } - }, [session.events, session.errors]) + }, [session.events, session.errors, contextValue.player]) const isPlayerReady = contextValue.store?.get().ready diff --git a/frontend/app/player/web/MessageManager.ts b/frontend/app/player/web/MessageManager.ts index f5916d5a8..2772ccbd2 100644 --- a/frontend/app/player/web/MessageManager.ts +++ b/frontend/app/player/web/MessageManager.ts @@ -139,8 +139,10 @@ export default class MessageManager { } public updateLists(lists: Partial) { - this.lists = new Lists(lists) - + Object.keys(lists).forEach((key: 'event' | 'stack' | 'exceptions') => { + const currentList = this.lists.lists[key] + lists[key]!.forEach(item => currentList.insert(item)) + }) lists?.event?.forEach((e: Record) => { if (e.type === EVENT_TYPES.LOCATION) { this.locationEventManager.append(e); diff --git a/frontend/app/player/web/messages/RawMessageReader.gen.ts b/frontend/app/player/web/messages/RawMessageReader.gen.ts index 72d6e2ff9..3f220a133 100644 --- a/frontend/app/player/web/messages/RawMessageReader.gen.ts +++ b/frontend/app/player/web/messages/RawMessageReader.gen.ts @@ -403,7 +403,7 @@ export default class RawMessageReader extends PrimitiveReader { const url = this.readString(); if (url === null) { return resetPointer() } const initiator = this.readString(); if (initiator === null) { return resetPointer() } return { - tp: MType.ResourceTimingLegacy, + tp: MType.ResourceTimingDeprecated, timestamp, duration, ttfb, diff --git a/frontend/app/player/web/messages/message.gen.ts b/frontend/app/player/web/messages/message.gen.ts index 4a1474f23..ea8f9902e 100644 --- a/frontend/app/player/web/messages/message.gen.ts +++ b/frontend/app/player/web/messages/message.gen.ts @@ -36,7 +36,7 @@ import type { RawPerformanceTrack, RawStringDict, RawSetNodeAttributeDict, - RawResourceTimingLegacy, + RawResourceTimingDeprecated, RawConnectionInformation, RawSetPageVisibility, RawLoadFontFace, @@ -135,7 +135,7 @@ export type StringDict = RawStringDict & Timed export type SetNodeAttributeDict = RawSetNodeAttributeDict & Timed -export type ResourceTimingLegacy = RawResourceTimingLegacy & Timed +export type ResourceTimingDeprecated = RawResourceTimingDeprecated & Timed export type ConnectionInformation = RawConnectionInformation & Timed diff --git a/frontend/app/player/web/messages/raw.gen.ts b/frontend/app/player/web/messages/raw.gen.ts index 86aba859c..01ed0cdbe 100644 --- a/frontend/app/player/web/messages/raw.gen.ts +++ b/frontend/app/player/web/messages/raw.gen.ts @@ -34,7 +34,7 @@ export const enum MType { PerformanceTrack = 49, StringDict = 50, SetNodeAttributeDict = 51, - ResourceTimingLegacy = 53, + ResourceTimingDeprecated = 53, ConnectionInformation = 54, SetPageVisibility = 55, LoadFontFace = 57, @@ -286,8 +286,8 @@ export interface RawSetNodeAttributeDict { valueKey: number, } -export interface RawResourceTimingLegacy { - tp: MType.ResourceTimingLegacy, +export interface RawResourceTimingDeprecated { + tp: MType.ResourceTimingDeprecated, timestamp: number, duration: number, ttfb: number, @@ -532,4 +532,4 @@ export interface RawIosNetworkCall { } -export type RawMessage = RawTimestamp | RawSetPageLocation | RawSetViewportSize | RawSetViewportScroll | RawCreateDocument | RawCreateElementNode | RawCreateTextNode | RawMoveNode | RawRemoveNode | RawSetNodeAttribute | RawRemoveNodeAttribute | RawSetNodeData | RawSetCssData | RawSetNodeScroll | RawSetInputValue | RawSetInputChecked | RawMouseMove | RawLegacyNetworkRequest | RawConsoleLog | RawCssInsertRule | RawCssDeleteRule | RawFetch | RawProfiler | RawOTable | RawRedux | RawVuex | RawMobX | RawNgRx | RawGraphQl | RawPerformanceTrack | RawStringDict | RawSetNodeAttributeDict | RawResourceTimingLegacy | RawConnectionInformation | RawSetPageVisibility | RawLoadFontFace | RawSetNodeFocus | RawLongTask | RawSetNodeAttributeURLBased | RawSetCssDataURLBased | RawCssInsertRuleURLBased | RawMouseClick | RawCreateIFrameDocument | RawAdoptedSsReplaceURLBased | RawAdoptedSsReplace | RawAdoptedSsInsertRuleURLBased | RawAdoptedSsInsertRule | RawAdoptedSsDeleteRule | RawAdoptedSsAddOwner | RawAdoptedSsRemoveOwner | RawZustand | RawSelectionChange | RawMouseThrashing | RawResourceTiming | RawNetworkRequest | RawIosSessionStart | RawIosCustomEvent | RawIosScreenChanges | RawIosClickEvent | RawIosPerformanceEvent | RawIosLog | RawIosNetworkCall; +export type RawMessage = RawTimestamp | RawSetPageLocation | RawSetViewportSize | RawSetViewportScroll | RawCreateDocument | RawCreateElementNode | RawCreateTextNode | RawMoveNode | RawRemoveNode | RawSetNodeAttribute | RawRemoveNodeAttribute | RawSetNodeData | RawSetCssData | RawSetNodeScroll | RawSetInputValue | RawSetInputChecked | RawMouseMove | RawLegacyNetworkRequest | RawConsoleLog | RawCssInsertRule | RawCssDeleteRule | RawFetch | RawProfiler | RawOTable | RawRedux | RawVuex | RawMobX | RawNgRx | RawGraphQl | RawPerformanceTrack | RawStringDict | RawSetNodeAttributeDict | RawResourceTimingDeprecated | RawConnectionInformation | RawSetPageVisibility | RawLoadFontFace | RawSetNodeFocus | RawLongTask | RawSetNodeAttributeURLBased | RawSetCssDataURLBased | RawCssInsertRuleURLBased | RawMouseClick | RawCreateIFrameDocument | RawAdoptedSsReplaceURLBased | RawAdoptedSsReplace | RawAdoptedSsInsertRuleURLBased | RawAdoptedSsInsertRule | RawAdoptedSsDeleteRule | RawAdoptedSsAddOwner | RawAdoptedSsRemoveOwner | RawZustand | RawSelectionChange | RawMouseThrashing | RawResourceTiming | RawNetworkRequest | RawIosSessionStart | RawIosCustomEvent | RawIosScreenChanges | RawIosClickEvent | RawIosPerformanceEvent | RawIosLog | RawIosNetworkCall; diff --git a/frontend/app/player/web/messages/tracker-legacy.gen.ts b/frontend/app/player/web/messages/tracker-legacy.gen.ts index 236a33da5..e83b0eec5 100644 --- a/frontend/app/player/web/messages/tracker-legacy.gen.ts +++ b/frontend/app/player/web/messages/tracker-legacy.gen.ts @@ -35,7 +35,7 @@ export const TP_MAP = { 49: MType.PerformanceTrack, 50: MType.StringDict, 51: MType.SetNodeAttributeDict, - 53: MType.ResourceTimingLegacy, + 53: MType.ResourceTimingDeprecated, 54: MType.ConnectionInformation, 55: MType.SetPageVisibility, 57: MType.LoadFontFace, diff --git a/frontend/app/player/web/messages/tracker.gen.ts b/frontend/app/player/web/messages/tracker.gen.ts index 31acd4fe7..bff29e429 100644 --- a/frontend/app/player/web/messages/tracker.gen.ts +++ b/frontend/app/player/web/messages/tracker.gen.ts @@ -271,7 +271,7 @@ type TrSetNodeAttributeDict = [ valueKey: number, ] -type TrResourceTimingLegacy = [ +type TrResourceTimingDeprecated = [ type: 53, timestamp: number, duration: number, @@ -484,7 +484,7 @@ type TrNetworkRequest = [ ] -export type TrackerMessage = TrTimestamp | TrSetPageLocation | TrSetViewportSize | TrSetViewportScroll | TrCreateDocument | TrCreateElementNode | TrCreateTextNode | TrMoveNode | TrRemoveNode | TrSetNodeAttribute | TrRemoveNodeAttribute | TrSetNodeData | TrSetNodeScroll | TrSetInputTarget | TrSetInputValue | TrSetInputChecked | TrMouseMove | TrLegacyNetworkRequest | TrConsoleLog | TrPageLoadTiming | TrPageRenderTiming | TrCustomEvent | TrUserID | TrUserAnonymousID | TrMetadata | TrCSSInsertRule | TrCSSDeleteRule | TrFetch | TrProfiler | TrOTable | TrStateAction | TrRedux | TrVuex | TrMobX | TrNgRx | TrGraphQL | TrPerformanceTrack | TrStringDict | TrSetNodeAttributeDict | TrResourceTimingLegacy | TrConnectionInformation | TrSetPageVisibility | TrLoadFontFace | TrSetNodeFocus | TrLongTask | TrSetNodeAttributeURLBased | TrSetCSSDataURLBased | TrTechnicalInfo | TrCustomIssue | TrCSSInsertRuleURLBased | TrMouseClick | TrCreateIFrameDocument | TrAdoptedSSReplaceURLBased | TrAdoptedSSInsertRuleURLBased | TrAdoptedSSDeleteRule | TrAdoptedSSAddOwner | TrAdoptedSSRemoveOwner | TrJSException | TrZustand | TrBatchMetadata | TrPartitionedMessage | TrInputChange | TrSelectionChange | TrMouseThrashing | TrUnbindNodes | TrResourceTiming | TrNetworkRequest +export type TrackerMessage = TrTimestamp | TrSetPageLocation | TrSetViewportSize | TrSetViewportScroll | TrCreateDocument | TrCreateElementNode | TrCreateTextNode | TrMoveNode | TrRemoveNode | TrSetNodeAttribute | TrRemoveNodeAttribute | TrSetNodeData | TrSetNodeScroll | TrSetInputTarget | TrSetInputValue | TrSetInputChecked | TrMouseMove | TrLegacyNetworkRequest | TrConsoleLog | TrPageLoadTiming | TrPageRenderTiming | TrCustomEvent | TrUserID | TrUserAnonymousID | TrMetadata | TrCSSInsertRule | TrCSSDeleteRule | TrFetch | TrProfiler | TrOTable | TrStateAction | TrRedux | TrVuex | TrMobX | TrNgRx | TrGraphQL | TrPerformanceTrack | TrStringDict | TrSetNodeAttributeDict | TrResourceTimingDeprecated | TrConnectionInformation | TrSetPageVisibility | TrLoadFontFace | TrSetNodeFocus | TrLongTask | TrSetNodeAttributeURLBased | TrSetCSSDataURLBased | TrTechnicalInfo | TrCustomIssue | TrCSSInsertRuleURLBased | TrMouseClick | TrCreateIFrameDocument | TrAdoptedSSReplaceURLBased | TrAdoptedSSInsertRuleURLBased | TrAdoptedSSDeleteRule | TrAdoptedSSAddOwner | TrAdoptedSSRemoveOwner | TrJSException | TrZustand | TrBatchMetadata | TrPartitionedMessage | TrInputChange | TrSelectionChange | TrMouseThrashing | TrUnbindNodes | TrResourceTiming | TrNetworkRequest export default function translate(tMsg: TrackerMessage): RawMessage | null { switch(tMsg[0]) { @@ -766,7 +766,7 @@ export default function translate(tMsg: TrackerMessage): RawMessage | null { case 53: { return { - tp: MType.ResourceTimingLegacy, + tp: MType.ResourceTimingDeprecated, timestamp: tMsg[1], duration: tMsg[2], ttfb: tMsg[3], diff --git a/mobs/messages.rb b/mobs/messages.rb index 1f75a8b5e..ad9cad41d 100644 --- a/mobs/messages.rb +++ b/mobs/messages.rb @@ -265,7 +265,7 @@ message 51, "SetNodeAttributeDict" do uint 'NameKey' uint 'ValueKey' end -message 53, 'ResourceTimingLegacy', :replayer => :devtools do +message 53, 'ResourceTimingDeprecated', :replayer => :devtools do uint 'Timestamp' uint 'Duration' uint 'TTFB' diff --git a/tracker/tracker/src/common/messages.gen.ts b/tracker/tracker/src/common/messages.gen.ts index 8018810a4..06a85410f 100644 --- a/tracker/tracker/src/common/messages.gen.ts +++ b/tracker/tracker/src/common/messages.gen.ts @@ -41,7 +41,7 @@ export declare const enum Type { PerformanceTrack = 49, StringDict = 50, SetNodeAttributeDict = 51, - ResourceTimingLegacy = 53, + ResourceTimingDeprecated = 53, ConnectionInformation = 54, SetPageVisibility = 55, LoadFontFace = 57, @@ -338,8 +338,8 @@ export type SetNodeAttributeDict = [ /*valueKey:*/ number, ] -export type ResourceTimingLegacy = [ - /*type:*/ Type.ResourceTimingLegacy, +export type ResourceTimingDeprecated = [ + /*type:*/ Type.ResourceTimingDeprecated, /*timestamp:*/ number, /*duration:*/ number, /*ttfb:*/ number, @@ -551,5 +551,5 @@ export type NetworkRequest = [ ] -type Message = Timestamp | SetPageLocation | SetViewportSize | SetViewportScroll | CreateDocument | CreateElementNode | CreateTextNode | MoveNode | RemoveNode | SetNodeAttribute | RemoveNodeAttribute | SetNodeData | SetNodeScroll | SetInputTarget | SetInputValue | SetInputChecked | MouseMove | LegacyNetworkRequest | ConsoleLog | PageLoadTiming | PageRenderTiming | CustomEvent | UserID | UserAnonymousID | Metadata | CSSInsertRule | CSSDeleteRule | Fetch | Profiler | OTable | StateAction | Redux | Vuex | MobX | NgRx | GraphQL | PerformanceTrack | StringDict | SetNodeAttributeDict | ResourceTimingLegacy | ConnectionInformation | SetPageVisibility | LoadFontFace | SetNodeFocus | LongTask | SetNodeAttributeURLBased | SetCSSDataURLBased | TechnicalInfo | CustomIssue | CSSInsertRuleURLBased | MouseClick | CreateIFrameDocument | AdoptedSSReplaceURLBased | AdoptedSSInsertRuleURLBased | AdoptedSSDeleteRule | AdoptedSSAddOwner | AdoptedSSRemoveOwner | JSException | Zustand | BatchMetadata | PartitionedMessage | InputChange | SelectionChange | MouseThrashing | UnbindNodes | ResourceTiming | NetworkRequest +type Message = Timestamp | SetPageLocation | SetViewportSize | SetViewportScroll | CreateDocument | CreateElementNode | CreateTextNode | MoveNode | RemoveNode | SetNodeAttribute | RemoveNodeAttribute | SetNodeData | SetNodeScroll | SetInputTarget | SetInputValue | SetInputChecked | MouseMove | LegacyNetworkRequest | ConsoleLog | PageLoadTiming | PageRenderTiming | CustomEvent | UserID | UserAnonymousID | Metadata | CSSInsertRule | CSSDeleteRule | Fetch | Profiler | OTable | StateAction | Redux | Vuex | MobX | NgRx | GraphQL | PerformanceTrack | StringDict | SetNodeAttributeDict | ResourceTimingDeprecated | ConnectionInformation | SetPageVisibility | LoadFontFace | SetNodeFocus | LongTask | SetNodeAttributeURLBased | SetCSSDataURLBased | TechnicalInfo | CustomIssue | CSSInsertRuleURLBased | MouseClick | CreateIFrameDocument | AdoptedSSReplaceURLBased | AdoptedSSInsertRuleURLBased | AdoptedSSDeleteRule | AdoptedSSAddOwner | AdoptedSSRemoveOwner | JSException | Zustand | BatchMetadata | PartitionedMessage | InputChange | SelectionChange | MouseThrashing | UnbindNodes | ResourceTiming | NetworkRequest export default Message diff --git a/tracker/tracker/src/main/app/messages.gen.ts b/tracker/tracker/src/main/app/messages.gen.ts index 30332a5fe..dcbc6f718 100644 --- a/tracker/tracker/src/main/app/messages.gen.ts +++ b/tracker/tracker/src/main/app/messages.gen.ts @@ -498,7 +498,7 @@ export function SetNodeAttributeDict( ] } -export function ResourceTimingLegacy( +export function ResourceTimingDeprecated( timestamp: number, duration: number, ttfb: number, @@ -507,9 +507,9 @@ export function ResourceTimingLegacy( decodedBodySize: number, url: string, initiator: string, -): Messages.ResourceTimingLegacy { +): Messages.ResourceTimingDeprecated { return [ - Messages.Type.ResourceTimingLegacy, + Messages.Type.ResourceTimingDeprecated, timestamp, duration, ttfb, diff --git a/tracker/tracker/src/main/modules/img.ts b/tracker/tracker/src/main/modules/img.ts index b5dddb293..0099f6969 100644 --- a/tracker/tracker/src/main/modules/img.ts +++ b/tracker/tracker/src/main/modules/img.ts @@ -60,7 +60,7 @@ export default function (app: App): void { const sendImgError = app.safe(function (img: HTMLImageElement): void { const resolvedSrc = resolveURL(img.src || '') // Src type is null sometimes. - is it true? if (isURL(resolvedSrc)) { - app.send(ResourceTiming(app.timestamp(), 0, 0, 0, 0, 0, resolvedSrc, 'img')) + app.send(ResourceTiming(app.timestamp(), 0, 0, 0, 0, 0, resolvedSrc, 'img', 0, false)) } }) diff --git a/tracker/tracker/src/webworker/MessageEncoder.gen.ts b/tracker/tracker/src/webworker/MessageEncoder.gen.ts index 5c54c6390..b88fec754 100644 --- a/tracker/tracker/src/webworker/MessageEncoder.gen.ts +++ b/tracker/tracker/src/webworker/MessageEncoder.gen.ts @@ -166,7 +166,7 @@ export default class MessageEncoder extends PrimitiveEncoder { return this.uint(msg[1]) && this.uint(msg[2]) && this.uint(msg[3]) break - case Messages.Type.ResourceTimingLegacy: + case Messages.Type.ResourceTimingDeprecated: return this.uint(msg[1]) && this.uint(msg[2]) && this.uint(msg[3]) && this.uint(msg[4]) && this.uint(msg[5]) && this.uint(msg[6]) && this.string(msg[7]) && this.string(msg[8]) break