diff --git a/backend/cmd/db/main.go b/backend/cmd/db/main.go index ee9f8a536..77ad5edd8 100644 --- a/backend/cmd/db/main.go +++ b/backend/cmd/db/main.go @@ -66,7 +66,7 @@ func main() { messages.MsgMetadata, messages.MsgIssueEvent, messages.MsgSessionStart, messages.MsgSessionEnd, messages.MsgUserID, messages.MsgUserAnonymousID, messages.MsgIntegrationEvent, messages.MsgPerformanceTrackAggr, messages.MsgJSException, messages.MsgResourceTiming, messages.MsgCustomEvent, messages.MsgCustomIssue, - messages.MsgNetworkRequest, messages.MsgGraphQL, messages.MsgStateAction, messages.MsgMouseClick, + messages.MsgFetch, messages.MsgNetworkRequest, messages.MsgGraphQL, messages.MsgStateAction, messages.MsgMouseClick, messages.MsgMouseClickDeprecated, messages.MsgSetPageLocation, messages.MsgSetPageLocationDeprecated, messages.MsgPageLoadTiming, messages.MsgPageRenderTiming, messages.MsgPageEvent, messages.MsgPageEventDeprecated, messages.MsgMouseThrashing, messages.MsgInputChange, diff --git a/backend/cmd/sink/main.go b/backend/cmd/sink/main.go index 5ecf87ff3..012729fb3 100644 --- a/backend/cmd/sink/main.go +++ b/backend/cmd/sink/main.go @@ -100,6 +100,7 @@ func main() { // Process assets if msg.TypeID() == messages.MsgSetNodeAttributeURLBased || msg.TypeID() == messages.MsgSetCSSDataURLBased || + msg.TypeID() == messages.MsgCSSInsertRuleURLBased || msg.TypeID() == messages.MsgAdoptedSSReplaceURLBased || msg.TypeID() == messages.MsgAdoptedSSInsertRuleURLBased { m := msg.Decode() diff --git a/backend/internal/sink/assetscache/assets.go b/backend/internal/sink/assetscache/assets.go index 9f490752e..82ae4b9bc 100644 --- a/backend/internal/sink/assetscache/assets.go +++ b/backend/internal/sink/assetscache/assets.go @@ -133,6 +133,17 @@ func (e *AssetsCache) ParseAssets(msg messages.Message) messages.Message { } newMsg.SetMeta(msg.Meta()) return newMsg + case *messages.CSSInsertRuleURLBased: + if e.shouldSkipAsset(m.BaseURL) { + return msg + } + newMsg := &messages.CSSInsertRule{ + ID: m.ID, + Index: m.Index, + Rule: e.handleCSS(m.SessionID(), m.BaseURL, m.Rule), + } + newMsg.SetMeta(msg.Meta()) + return newMsg case *messages.AdoptedSSReplaceURLBased: if e.shouldSkipAsset(m.BaseURL) { return msg diff --git a/backend/pkg/handlers/web/deadClick.go b/backend/pkg/handlers/web/deadClick.go index 78d2f4408..e2c9dc10c 100644 --- a/backend/pkg/handlers/web/deadClick.go +++ b/backend/pkg/handlers/web/deadClick.go @@ -77,6 +77,8 @@ func (d *DeadClickDetector) Handle(message Message, timestamp uint64) Message { *MoveNode, *RemoveNode, *SetCSSData, + *CSSInsertRule, + *CSSDeleteRule, *SetInputValue, *SetInputChecked: return d.Build() diff --git a/backend/pkg/messages/filters.go b/backend/pkg/messages/filters.go index efd957240..094586abf 100644 --- a/backend/pkg/messages/filters.go +++ b/backend/pkg/messages/filters.go @@ -2,7 +2,7 @@ package messages func IsReplayerType(id int) bool { - return 1 != id && 17 != id && 23 != id && 24 != id && 26 != id && 27 != id && 28 != id && 29 != id && 30 != id && 31 != id && 32 != id && 33 != id && 42 != id && 56 != id && 63 != id && 64 != id && 66 != id && 78 != id && 81 != id && 82 != id && 112 != id && 115 != id && 124 != id && 125 != id && 126 != id && 127 != id && 90 != id && 91 != id && 92 != id && 94 != id && 95 != id && 97 != id && 98 != id && 107 != id && 110 != id + return 1 != id && 3 != id && 17 != id && 23 != id && 24 != id && 25 != id && 26 != id && 27 != id && 28 != id && 29 != id && 30 != id && 31 != id && 32 != id && 33 != id && 42 != id && 56 != id && 62 != id && 63 != id && 64 != id && 66 != id && 78 != id && 80 != id && 81 != id && 82 != id && 112 != id && 115 != id && 124 != id && 125 != id && 126 != id && 127 != id && 90 != id && 91 != id && 92 != id && 94 != id && 95 != id && 97 != id && 98 != id && 107 != id && 110 != id } func IsMobileType(id int) bool { @@ -10,5 +10,5 @@ func IsMobileType(id int) bool { } func IsDOMType(id int) bool { - return 0 == id || 4 == id || 5 == id || 6 == id || 7 == id || 8 == id || 9 == id || 10 == id || 11 == id || 12 == id || 13 == id || 14 == id || 15 == id || 16 == id || 18 == id || 19 == id || 20 == id || 34 == id || 35 == id || 49 == id || 50 == id || 51 == id || 43 == id || 52 == id || 54 == id || 55 == id || 57 == id || 58 == id || 60 == id || 61 == id || 68 == id || 69 == id || 70 == id || 71 == id || 72 == id || 73 == id || 74 == id || 75 == id || 76 == id || 77 == id || 113 == id || 114 == id || 117 == id || 118 == id || 119 == id || 122 == id || 93 == id || 96 == id || 100 == id || 101 == id || 102 == id || 103 == id || 104 == id || 105 == id || 106 == id || 111 == id + return 0 == id || 4 == id || 5 == id || 6 == id || 7 == id || 8 == id || 9 == id || 10 == id || 11 == id || 12 == id || 13 == id || 14 == id || 15 == id || 16 == id || 18 == id || 19 == id || 20 == id || 34 == id || 35 == id || 37 == id || 38 == id || 49 == id || 50 == id || 51 == id || 43 == id || 52 == id || 54 == id || 55 == id || 57 == id || 58 == id || 59 == id || 60 == id || 61 == id || 67 == id || 68 == id || 69 == id || 70 == id || 71 == id || 72 == id || 73 == id || 74 == id || 75 == id || 76 == id || 77 == id || 113 == id || 114 == id || 117 == id || 118 == id || 119 == id || 122 == id || 93 == id || 96 == id || 100 == id || 101 == id || 102 == id || 103 == id || 104 == id || 105 == id || 106 == id || 111 == id } diff --git a/backend/pkg/messages/iterator.go b/backend/pkg/messages/iterator.go index db7d50614..304f15812 100644 --- a/backend/pkg/messages/iterator.go +++ b/backend/pkg/messages/iterator.go @@ -44,8 +44,9 @@ func NewMessageIterator(log logger.Logger, messageHandler MessageHandler, messag iter.filter = filter } iter.preFilter = map[int]struct{}{ - MsgBatchMetadata: {}, MsgTimestamp: {}, MsgSessionStart: {}, - MsgSessionEnd: {}, MsgSetPageLocation: {}, MsgMobileBatchMeta: {}, + MsgBatchMetadata: {}, MsgBatchMeta: {}, MsgTimestamp: {}, + MsgSessionStart: {}, MsgSessionEnd: {}, MsgSetPageLocation: {}, + MsgMobileBatchMeta: {}, } return iter } @@ -151,6 +152,20 @@ func (i *messageIteratorImpl) preprocessing(msg Message) error { i.version = m.Version i.batchInfo.version = m.Version + case *BatchMeta: // Is not required to be present in batch since Mobile doesn't have it (though we might change it) + if i.messageInfo.Index > 1 { // Might be several 0-0 BatchMeta in a row without an error though + return fmt.Errorf("batchMeta found at the end of the batch, info: %s", i.batchInfo.Info()) + } + i.messageInfo.Index = m.PageNo<<32 + m.FirstIndex // 2^32 is the maximum count of messages per page (ha-ha) + i.messageInfo.Timestamp = uint64(m.Timestamp) + if m.Timestamp == 0 { + i.zeroTsLog("BatchMeta") + } + // Try to get saved session's page url + if savedURL := i.urls.Get(i.messageInfo.batch.sessionID); savedURL != "" { + i.messageInfo.Url = savedURL + } + case *Timestamp: i.messageInfo.Timestamp = m.Timestamp if m.Timestamp == 0 { diff --git a/backend/pkg/messages/legacy-message-transform.go b/backend/pkg/messages/legacy-message-transform.go index 2d97e252b..23ab1e52d 100644 --- a/backend/pkg/messages/legacy-message-transform.go +++ b/backend/pkg/messages/legacy-message-transform.go @@ -2,6 +2,34 @@ package messages func transformDeprecated(msg Message) Message { switch m := msg.(type) { + case *JSExceptionDeprecated: + return &JSException{ + Name: m.Name, + Message: m.Message, + Payload: m.Payload, + Metadata: "{}", + } + case *Fetch: + return &NetworkRequest{ + Type: "fetch", + Method: m.Method, + URL: m.URL, + Request: m.Request, + Response: m.Response, + Status: m.Status, + Timestamp: m.Timestamp, + Duration: m.Duration, + } + case *IssueEventDeprecated: + return &IssueEvent{ + MessageID: m.MessageID, + Timestamp: m.Timestamp, + Type: m.Type, + ContextString: m.ContextString, + Context: m.Context, + Payload: m.Payload, + URL: "", + } case *ResourceTimingDeprecated: return &ResourceTiming{ Timestamp: m.Timestamp, diff --git a/backend/pkg/messages/messages.go b/backend/pkg/messages/messages.go index a554812fe..d4f184d48 100644 --- a/backend/pkg/messages/messages.go +++ b/backend/pkg/messages/messages.go @@ -4,6 +4,7 @@ package messages const ( MsgTimestamp = 0 MsgSessionStart = 1 + MsgSessionEndDeprecated = 3 MsgSetPageLocationDeprecated = 4 MsgSetViewportSize = 5 MsgSetViewportScroll = 6 @@ -25,6 +26,7 @@ const ( MsgConsoleLog = 22 MsgPageLoadTiming = 23 MsgPageRenderTiming = 24 + MsgJSExceptionDeprecated = 25 MsgIntegrationEvent = 26 MsgCustomEvent = 27 MsgUserID = 28 @@ -35,6 +37,9 @@ const ( MsgPageEvent = 33 MsgStringDictGlobal = 34 MsgSetNodeAttributeDictGlobal = 35 + MsgCSSInsertRule = 37 + MsgCSSDeleteRule = 38 + MsgFetch = 39 MsgProfiler = 40 MsgOTable = 41 MsgStateAction = 42 @@ -54,11 +59,14 @@ const ( MsgPerformanceTrackAggr = 56 MsgLoadFontFace = 57 MsgSetNodeFocus = 58 + MsgLongTask = 59 MsgSetNodeAttributeURLBased = 60 MsgSetCSSDataURLBased = 61 + MsgIssueEventDeprecated = 62 MsgTechnicalInfo = 63 MsgCustomIssue = 64 MsgAssetCache = 66 + MsgCSSInsertRuleURLBased = 67 MsgMouseClick = 68 MsgMouseClickDeprecated = 69 MsgCreateIFrameDocument = 70 @@ -71,6 +79,7 @@ const ( MsgAdoptedSSRemoveOwner = 77 MsgJSException = 78 MsgZustand = 79 + MsgBatchMeta = 80 MsgBatchMetadata = 81 MsgPartitionedMessage = 82 MsgNetworkRequest = 83 @@ -184,6 +193,27 @@ func (msg *SessionStart) TypeID() int { return 1 } +type SessionEndDeprecated struct { + message + Timestamp uint64 +} + +func (msg *SessionEndDeprecated) Encode() []byte { + buf := make([]byte, 11) + buf[0] = 3 + p := 1 + p = WriteUint(msg.Timestamp, buf, p) + return buf[:p] +} + +func (msg *SessionEndDeprecated) Decode() Message { + return msg +} + +func (msg *SessionEndDeprecated) TypeID() int { + return 3 +} + type SetPageLocationDeprecated struct { message URL string @@ -708,6 +738,31 @@ func (msg *PageRenderTiming) TypeID() int { return 24 } +type JSExceptionDeprecated struct { + message + Name string + Message string + Payload string +} + +func (msg *JSExceptionDeprecated) Encode() []byte { + buf := make([]byte, 31+len(msg.Name)+len(msg.Message)+len(msg.Payload)) + buf[0] = 25 + p := 1 + p = WriteString(msg.Name, buf, p) + p = WriteString(msg.Message, buf, p) + p = WriteString(msg.Payload, buf, p) + return buf[:p] +} + +func (msg *JSExceptionDeprecated) Decode() Message { + return msg +} + +func (msg *JSExceptionDeprecated) TypeID() int { + return 25 +} + type IntegrationEvent struct { message Timestamp uint64 @@ -1010,6 +1065,87 @@ func (msg *SetNodeAttributeDictGlobal) TypeID() int { return 35 } +type CSSInsertRule struct { + message + ID uint64 + Rule string + Index uint64 +} + +func (msg *CSSInsertRule) Encode() []byte { + buf := make([]byte, 31+len(msg.Rule)) + buf[0] = 37 + p := 1 + p = WriteUint(msg.ID, buf, p) + p = WriteString(msg.Rule, buf, p) + p = WriteUint(msg.Index, buf, p) + return buf[:p] +} + +func (msg *CSSInsertRule) Decode() Message { + return msg +} + +func (msg *CSSInsertRule) TypeID() int { + return 37 +} + +type CSSDeleteRule struct { + message + ID uint64 + Index uint64 +} + +func (msg *CSSDeleteRule) Encode() []byte { + buf := make([]byte, 21) + buf[0] = 38 + p := 1 + p = WriteUint(msg.ID, buf, p) + p = WriteUint(msg.Index, buf, p) + return buf[:p] +} + +func (msg *CSSDeleteRule) Decode() Message { + return msg +} + +func (msg *CSSDeleteRule) TypeID() int { + return 38 +} + +type Fetch struct { + message + Method string + URL string + Request string + Response string + Status uint64 + Timestamp uint64 + Duration uint64 +} + +func (msg *Fetch) Encode() []byte { + buf := make([]byte, 71+len(msg.Method)+len(msg.URL)+len(msg.Request)+len(msg.Response)) + buf[0] = 39 + p := 1 + p = WriteString(msg.Method, buf, p) + p = WriteString(msg.URL, buf, p) + p = WriteString(msg.Request, buf, p) + p = WriteString(msg.Response, buf, p) + p = WriteUint(msg.Status, buf, p) + p = WriteUint(msg.Timestamp, buf, p) + p = WriteUint(msg.Duration, buf, p) + return buf[:p] +} + +func (msg *Fetch) Decode() Message { + return msg +} + +func (msg *Fetch) TypeID() int { + return 39 +} + type Profiler struct { message Name string @@ -1503,6 +1639,39 @@ func (msg *SetNodeFocus) TypeID() int { return 58 } +type LongTask struct { + message + Timestamp uint64 + Duration uint64 + Context uint64 + ContainerType uint64 + ContainerSrc string + ContainerId string + ContainerName string +} + +func (msg *LongTask) Encode() []byte { + buf := make([]byte, 71+len(msg.ContainerSrc)+len(msg.ContainerId)+len(msg.ContainerName)) + buf[0] = 59 + p := 1 + p = WriteUint(msg.Timestamp, buf, p) + p = WriteUint(msg.Duration, buf, p) + p = WriteUint(msg.Context, buf, p) + p = WriteUint(msg.ContainerType, buf, p) + p = WriteString(msg.ContainerSrc, buf, p) + p = WriteString(msg.ContainerId, buf, p) + p = WriteString(msg.ContainerName, buf, p) + return buf[:p] +} + +func (msg *LongTask) Decode() Message { + return msg +} + +func (msg *LongTask) TypeID() int { + return 59 +} + type SetNodeAttributeURLBased struct { message ID uint64 @@ -1555,6 +1724,37 @@ func (msg *SetCSSDataURLBased) TypeID() int { return 61 } +type IssueEventDeprecated struct { + message + MessageID uint64 + Timestamp uint64 + Type string + ContextString string + Context string + Payload string +} + +func (msg *IssueEventDeprecated) Encode() []byte { + buf := make([]byte, 61+len(msg.Type)+len(msg.ContextString)+len(msg.Context)+len(msg.Payload)) + buf[0] = 62 + p := 1 + p = WriteUint(msg.MessageID, buf, p) + p = WriteUint(msg.Timestamp, buf, p) + p = WriteString(msg.Type, buf, p) + p = WriteString(msg.ContextString, buf, p) + p = WriteString(msg.Context, buf, p) + p = WriteString(msg.Payload, buf, p) + return buf[:p] +} + +func (msg *IssueEventDeprecated) Decode() Message { + return msg +} + +func (msg *IssueEventDeprecated) TypeID() int { + return 62 +} + type TechnicalInfo struct { message Type string @@ -1622,6 +1822,33 @@ func (msg *AssetCache) TypeID() int { return 66 } +type CSSInsertRuleURLBased struct { + message + ID uint64 + Rule string + Index uint64 + BaseURL string +} + +func (msg *CSSInsertRuleURLBased) Encode() []byte { + buf := make([]byte, 41+len(msg.Rule)+len(msg.BaseURL)) + buf[0] = 67 + p := 1 + p = WriteUint(msg.ID, buf, p) + p = WriteString(msg.Rule, buf, p) + p = WriteUint(msg.Index, buf, p) + p = WriteString(msg.BaseURL, buf, p) + return buf[:p] +} + +func (msg *CSSInsertRuleURLBased) Decode() Message { + return msg +} + +func (msg *CSSInsertRuleURLBased) TypeID() int { + return 67 +} + type MouseClick struct { message ID uint64 @@ -1922,6 +2149,31 @@ func (msg *Zustand) TypeID() int { return 79 } +type BatchMeta struct { + message + PageNo uint64 + FirstIndex uint64 + Timestamp int64 +} + +func (msg *BatchMeta) Encode() []byte { + buf := make([]byte, 31) + buf[0] = 80 + p := 1 + p = WriteUint(msg.PageNo, buf, p) + p = WriteUint(msg.FirstIndex, buf, p) + p = WriteInt(msg.Timestamp, buf, p) + return buf[:p] +} + +func (msg *BatchMeta) Decode() Message { + return msg +} + +func (msg *BatchMeta) TypeID() int { + return 80 +} + type BatchMetadata struct { message Version uint64 diff --git a/backend/pkg/messages/read-message.go b/backend/pkg/messages/read-message.go index 380e0b6b2..f0051a042 100644 --- a/backend/pkg/messages/read-message.go +++ b/backend/pkg/messages/read-message.go @@ -68,6 +68,15 @@ func DecodeSessionStart(reader BytesReader) (Message, error) { return msg, err } +func DecodeSessionEndDeprecated(reader BytesReader) (Message, error) { + var err error = nil + msg := &SessionEndDeprecated{} + if msg.Timestamp, err = reader.ReadUint(); err != nil { + return nil, err + } + return msg, err +} + func DecodeSetPageLocationDeprecated(reader BytesReader) (Message, error) { var err error = nil msg := &SetPageLocationDeprecated{} @@ -381,6 +390,21 @@ func DecodePageRenderTiming(reader BytesReader) (Message, error) { return msg, err } +func DecodeJSExceptionDeprecated(reader BytesReader) (Message, error) { + var err error = nil + msg := &JSExceptionDeprecated{} + if msg.Name, err = reader.ReadString(); err != nil { + return nil, err + } + if msg.Message, err = reader.ReadString(); err != nil { + return nil, err + } + if msg.Payload, err = reader.ReadString(); err != nil { + return nil, err + } + return msg, err +} + func DecodeIntegrationEvent(reader BytesReader) (Message, error) { var err error = nil msg := &IntegrationEvent{} @@ -609,6 +633,60 @@ func DecodeSetNodeAttributeDictGlobal(reader BytesReader) (Message, error) { return msg, err } +func DecodeCSSInsertRule(reader BytesReader) (Message, error) { + var err error = nil + msg := &CSSInsertRule{} + if msg.ID, err = reader.ReadUint(); err != nil { + return nil, err + } + if msg.Rule, err = reader.ReadString(); err != nil { + return nil, err + } + if msg.Index, err = reader.ReadUint(); err != nil { + return nil, err + } + return msg, err +} + +func DecodeCSSDeleteRule(reader BytesReader) (Message, error) { + var err error = nil + msg := &CSSDeleteRule{} + if msg.ID, err = reader.ReadUint(); err != nil { + return nil, err + } + if msg.Index, err = reader.ReadUint(); err != nil { + return nil, err + } + return msg, err +} + +func DecodeFetch(reader BytesReader) (Message, error) { + var err error = nil + msg := &Fetch{} + if msg.Method, err = reader.ReadString(); err != nil { + return nil, err + } + if msg.URL, err = reader.ReadString(); err != nil { + return nil, err + } + if msg.Request, err = reader.ReadString(); err != nil { + return nil, err + } + if msg.Response, err = reader.ReadString(); err != nil { + return nil, err + } + if msg.Status, err = reader.ReadUint(); err != nil { + return nil, err + } + if msg.Timestamp, err = reader.ReadUint(); err != nil { + return nil, err + } + if msg.Duration, err = reader.ReadUint(); err != nil { + return nil, err + } + return msg, err +} + func DecodeProfiler(reader BytesReader) (Message, error) { var err error = nil msg := &Profiler{} @@ -921,6 +999,33 @@ func DecodeSetNodeFocus(reader BytesReader) (Message, error) { return msg, err } +func DecodeLongTask(reader BytesReader) (Message, error) { + var err error = nil + msg := &LongTask{} + if msg.Timestamp, err = reader.ReadUint(); err != nil { + return nil, err + } + if msg.Duration, err = reader.ReadUint(); err != nil { + return nil, err + } + if msg.Context, err = reader.ReadUint(); err != nil { + return nil, err + } + if msg.ContainerType, err = reader.ReadUint(); err != nil { + return nil, err + } + if msg.ContainerSrc, err = reader.ReadString(); err != nil { + return nil, err + } + if msg.ContainerId, err = reader.ReadString(); err != nil { + return nil, err + } + if msg.ContainerName, err = reader.ReadString(); err != nil { + return nil, err + } + return msg, err +} + func DecodeSetNodeAttributeURLBased(reader BytesReader) (Message, error) { var err error = nil msg := &SetNodeAttributeURLBased{} @@ -954,6 +1059,30 @@ func DecodeSetCSSDataURLBased(reader BytesReader) (Message, error) { return msg, err } +func DecodeIssueEventDeprecated(reader BytesReader) (Message, error) { + var err error = nil + msg := &IssueEventDeprecated{} + if msg.MessageID, err = reader.ReadUint(); err != nil { + return nil, err + } + if msg.Timestamp, err = reader.ReadUint(); err != nil { + return nil, err + } + if msg.Type, err = reader.ReadString(); err != nil { + return nil, err + } + if msg.ContextString, err = reader.ReadString(); err != nil { + return nil, err + } + if msg.Context, err = reader.ReadString(); err != nil { + return nil, err + } + if msg.Payload, err = reader.ReadString(); err != nil { + return nil, err + } + return msg, err +} + func DecodeTechnicalInfo(reader BytesReader) (Message, error) { var err error = nil msg := &TechnicalInfo{} @@ -987,6 +1116,24 @@ func DecodeAssetCache(reader BytesReader) (Message, error) { return msg, err } +func DecodeCSSInsertRuleURLBased(reader BytesReader) (Message, error) { + var err error = nil + msg := &CSSInsertRuleURLBased{} + if msg.ID, err = reader.ReadUint(); err != nil { + return nil, err + } + if msg.Rule, err = reader.ReadString(); err != nil { + return nil, err + } + if msg.Index, err = reader.ReadUint(); err != nil { + return nil, err + } + if msg.BaseURL, err = reader.ReadString(); err != nil { + return nil, err + } + return msg, err +} + func DecodeMouseClick(reader BytesReader) (Message, error) { var err error = nil msg := &MouseClick{} @@ -1167,6 +1314,21 @@ func DecodeZustand(reader BytesReader) (Message, error) { return msg, err } +func DecodeBatchMeta(reader BytesReader) (Message, error) { + var err error = nil + msg := &BatchMeta{} + if msg.PageNo, err = reader.ReadUint(); err != nil { + return nil, err + } + if msg.FirstIndex, err = reader.ReadUint(); err != nil { + return nil, err + } + if msg.Timestamp, err = reader.ReadInt(); err != nil { + return nil, err + } + return msg, err +} + func DecodeBatchMetadata(reader BytesReader) (Message, error) { var err error = nil msg := &BatchMetadata{} @@ -1926,6 +2088,8 @@ func ReadMessage(t uint64, reader BytesReader) (Message, error) { return DecodeTimestamp(reader) case 1: return DecodeSessionStart(reader) + case 3: + return DecodeSessionEndDeprecated(reader) case 4: return DecodeSetPageLocationDeprecated(reader) case 5: @@ -1968,6 +2132,8 @@ func ReadMessage(t uint64, reader BytesReader) (Message, error) { return DecodePageLoadTiming(reader) case 24: return DecodePageRenderTiming(reader) + case 25: + return DecodeJSExceptionDeprecated(reader) case 26: return DecodeIntegrationEvent(reader) case 27: @@ -1988,6 +2154,12 @@ func ReadMessage(t uint64, reader BytesReader) (Message, error) { return DecodeStringDictGlobal(reader) case 35: return DecodeSetNodeAttributeDictGlobal(reader) + case 37: + return DecodeCSSInsertRule(reader) + case 38: + return DecodeCSSDeleteRule(reader) + case 39: + return DecodeFetch(reader) case 40: return DecodeProfiler(reader) case 41: @@ -2026,16 +2198,22 @@ func ReadMessage(t uint64, reader BytesReader) (Message, error) { return DecodeLoadFontFace(reader) case 58: return DecodeSetNodeFocus(reader) + case 59: + return DecodeLongTask(reader) case 60: return DecodeSetNodeAttributeURLBased(reader) case 61: return DecodeSetCSSDataURLBased(reader) + case 62: + return DecodeIssueEventDeprecated(reader) case 63: return DecodeTechnicalInfo(reader) case 64: return DecodeCustomIssue(reader) case 66: return DecodeAssetCache(reader) + case 67: + return DecodeCSSInsertRuleURLBased(reader) case 68: return DecodeMouseClick(reader) case 69: @@ -2060,6 +2238,8 @@ func ReadMessage(t uint64, reader BytesReader) (Message, error) { return DecodeJSException(reader) case 79: return DecodeZustand(reader) + case 80: + return DecodeBatchMeta(reader) case 81: return DecodeBatchMetadata(reader) case 82: diff --git a/backend/pkg/messages/reader.go b/backend/pkg/messages/reader.go index a72331d63..436876e55 100644 --- a/backend/pkg/messages/reader.go +++ b/backend/pkg/messages/reader.go @@ -89,13 +89,15 @@ func (m *messageReaderImpl) Parse() (err error) { if err != nil { return fmt.Errorf("read message err: %s", err) } - if m.msgType == MsgBatchMetadata { + if m.msgType == MsgBatchMeta || m.msgType == MsgBatchMetadata { if len(m.list) > 0 { return fmt.Errorf("batch meta not at the start of batch") } switch message := msg.(type) { case *BatchMetadata: m.version = int(message.Version) + case *BatchMeta: + m.version = 0 } if m.version != 1 { // Unsupported tracker version, reset reader diff --git a/backend/pkg/sessions/api/web/handlers.go b/backend/pkg/sessions/api/web/handlers.go index af509d8f6..a8538ba3f 100644 --- a/backend/pkg/sessions/api/web/handlers.go +++ b/backend/pkg/sessions/api/web/handlers.go @@ -79,34 +79,31 @@ func (e *handlersImpl) GetAll() []*api.Description { } } -func getSessionTimestamp(req *StartSessionRequest, startTimeMili int64) uint64 { +func getSessionTimestamp(req *StartSessionRequest, startTimeMili int64) (ts uint64) { + ts = uint64(req.Timestamp) if req.IsOffline { - return uint64(req.Timestamp) + return } - ts := uint64(startTimeMili) - if req.BufferDiff > 0 && req.BufferDiff < 5*60*1000 { - ts -= req.BufferDiff - } - return ts -} - -func validateTrackerVersion(ver string) error { - c, err := semver.NewConstraint(">=6.0.0") + c, err := semver.NewConstraint(">=4.1.6") if err != nil { - return err + return } + ver := req.TrackerVersion parts := strings.Split(ver, "-") if len(parts) > 1 { ver = parts[0] } v, err := semver.NewVersion(ver) if err != nil { - return err + return } - if !c.Check(v) { - return errors.New("unsupported tracker version") + if c.Check(v) { + ts = uint64(startTimeMili) + if req.BufferDiff > 0 && req.BufferDiff < 5*60*1000 { + ts -= req.BufferDiff + } } - return nil + return } func (e *handlersImpl) startSessionHandlerWeb(w http.ResponseWriter, r *http.Request) { diff --git a/ee/connectors/msgcodec/messages.py b/ee/connectors/msgcodec/messages.py index dfd38a369..53450583d 100644 --- a/ee/connectors/msgcodec/messages.py +++ b/ee/connectors/msgcodec/messages.py @@ -35,6 +35,13 @@ class SessionStart(Message): self.user_id = user_id +class SessionEndDeprecated(Message): + __id__ = 3 + + def __init__(self, timestamp): + self.timestamp = timestamp + + class SetPageLocationDeprecated(Message): __id__ = 4 @@ -224,6 +231,15 @@ class PageRenderTiming(Message): self.time_to_interactive = time_to_interactive +class JSExceptionDeprecated(Message): + __id__ = 25 + + def __init__(self, name, message, payload): + self.name = name + self.message = message + self.payload = payload + + class IntegrationEvent(Message): __id__ = 26 @@ -323,21 +339,34 @@ class PageEvent(Message): self.web_vitals = web_vitals -class StringDictGlobal(Message): - __id__ = 34 +class CSSInsertRule(Message): + __id__ = 37 - def __init__(self, key, value): - self.key = key - self.value = value - - -class SetNodeAttributeDictGlobal(Message): - __id__ = 35 - - def __init__(self, id, name, value): + def __init__(self, id, rule, index): self.id = id - self.name = name - self.value = value + self.rule = rule + self.index = index + + +class CSSDeleteRule(Message): + __id__ = 38 + + def __init__(self, id, index): + self.id = id + self.index = index + + +class Fetch(Message): + __id__ = 39 + + def __init__(self, method, url, request, response, status, timestamp, duration): + self.method = method + self.url = url + self.request = request + self.response = response + self.status = status + self.timestamp = timestamp + self.duration = duration class Profiler(Message): @@ -520,6 +549,19 @@ class SetNodeFocus(Message): self.id = id +class LongTask(Message): + __id__ = 59 + + def __init__(self, timestamp, duration, context, container_type, container_src, container_id, container_name): + self.timestamp = timestamp + self.duration = duration + self.context = context + self.container_type = container_type + self.container_src = container_src + self.container_id = container_id + self.container_name = container_name + + class SetNodeAttributeURLBased(Message): __id__ = 60 @@ -539,6 +581,18 @@ class SetCSSDataURLBased(Message): self.base_url = base_url +class IssueEventDeprecated(Message): + __id__ = 62 + + def __init__(self, message_id, timestamp, type, context_string, context, payload): + self.message_id = message_id + self.timestamp = timestamp + self.type = type + self.context_string = context_string + self.context = context + self.payload = payload + + class TechnicalInfo(Message): __id__ = 63 @@ -562,6 +616,16 @@ class AssetCache(Message): self.url = url +class CSSInsertRuleURLBased(Message): + __id__ = 67 + + def __init__(self, id, rule, index, base_url): + self.id = id + self.rule = rule + self.index = index + self.base_url = base_url + + class MouseClick(Message): __id__ = 68 @@ -670,6 +734,15 @@ class Zustand(Message): self.state = state +class BatchMeta(Message): + __id__ = 80 + + def __init__(self, page_no, first_index, timestamp): + self.page_no = page_no + self.first_index = first_index + self.timestamp = timestamp + + class BatchMetadata(Message): __id__ = 81 diff --git a/ee/connectors/msgcodec/messages.pyx b/ee/connectors/msgcodec/messages.pyx index d84f4a1c5..b07658d51 100644 --- a/ee/connectors/msgcodec/messages.pyx +++ b/ee/connectors/msgcodec/messages.pyx @@ -58,6 +58,15 @@ cdef class SessionStart(PyMessage): self.user_id = user_id +cdef class SessionEndDeprecated(PyMessage): + cdef public int __id__ + cdef public unsigned long timestamp + + def __init__(self, unsigned long timestamp): + self.__id__ = 3 + self.timestamp = timestamp + + cdef class SetPageLocationDeprecated(PyMessage): cdef public int __id__ cdef public str url @@ -331,6 +340,19 @@ cdef class PageRenderTiming(PyMessage): self.time_to_interactive = time_to_interactive +cdef class JSExceptionDeprecated(PyMessage): + cdef public int __id__ + cdef public str name + cdef public str message + cdef public str payload + + def __init__(self, str name, str message, str payload): + self.__id__ = 25 + self.name = name + self.message = message + self.payload = payload + + cdef class IntegrationEvent(PyMessage): cdef public int __id__ cdef public unsigned long timestamp @@ -489,28 +511,49 @@ cdef class PageEvent(PyMessage): self.web_vitals = web_vitals -cdef class StringDictGlobal(PyMessage): - cdef public int __id__ - cdef public unsigned long key - cdef public str value - - def __init__(self, unsigned long key, str value): - self.__id__ = 34 - self.key = key - self.value = value - - -cdef class SetNodeAttributeDictGlobal(PyMessage): +cdef class CSSInsertRule(PyMessage): cdef public int __id__ cdef public unsigned long id - cdef public unsigned long name - cdef public unsigned long value + cdef public str rule + cdef public unsigned long index - def __init__(self, unsigned long id, unsigned long name, unsigned long value): - self.__id__ = 35 + def __init__(self, unsigned long id, str rule, unsigned long index): + self.__id__ = 37 self.id = id - self.name = name - self.value = value + self.rule = rule + self.index = index + + +cdef class CSSDeleteRule(PyMessage): + cdef public int __id__ + cdef public unsigned long id + cdef public unsigned long index + + def __init__(self, unsigned long id, unsigned long index): + self.__id__ = 38 + self.id = id + self.index = index + + +cdef class Fetch(PyMessage): + cdef public int __id__ + cdef public str method + cdef public str url + cdef public str request + cdef public str response + cdef public unsigned long status + cdef public unsigned long timestamp + cdef public unsigned long duration + + def __init__(self, str method, str url, str request, str response, unsigned long status, unsigned long timestamp, unsigned long duration): + self.__id__ = 39 + self.method = method + self.url = url + self.request = request + self.response = response + self.status = status + self.timestamp = timestamp + self.duration = duration cdef class Profiler(PyMessage): @@ -778,6 +821,27 @@ cdef class SetNodeFocus(PyMessage): self.id = id +cdef class LongTask(PyMessage): + cdef public int __id__ + cdef public unsigned long timestamp + cdef public unsigned long duration + cdef public unsigned long context + cdef public unsigned long container_type + cdef public str container_src + cdef public str container_id + cdef public str container_name + + def __init__(self, unsigned long timestamp, unsigned long duration, unsigned long context, unsigned long container_type, str container_src, str container_id, str container_name): + self.__id__ = 59 + self.timestamp = timestamp + self.duration = duration + self.context = context + self.container_type = container_type + self.container_src = container_src + self.container_id = container_id + self.container_name = container_name + + cdef class SetNodeAttributeURLBased(PyMessage): cdef public int __id__ cdef public unsigned long id @@ -806,6 +870,25 @@ cdef class SetCSSDataURLBased(PyMessage): self.base_url = base_url +cdef class IssueEventDeprecated(PyMessage): + cdef public int __id__ + cdef public unsigned long message_id + cdef public unsigned long timestamp + cdef public str type + cdef public str context_string + cdef public str context + cdef public str payload + + def __init__(self, unsigned long message_id, unsigned long timestamp, str type, str context_string, str context, str payload): + self.__id__ = 62 + self.message_id = message_id + self.timestamp = timestamp + self.type = type + self.context_string = context_string + self.context = context + self.payload = payload + + cdef class TechnicalInfo(PyMessage): cdef public int __id__ cdef public str type @@ -837,6 +920,21 @@ cdef class AssetCache(PyMessage): self.url = url +cdef class CSSInsertRuleURLBased(PyMessage): + cdef public int __id__ + cdef public unsigned long id + cdef public str rule + cdef public unsigned long index + cdef public str base_url + + def __init__(self, unsigned long id, str rule, unsigned long index, str base_url): + self.__id__ = 67 + self.id = id + self.rule = rule + self.index = index + self.base_url = base_url + + cdef class MouseClick(PyMessage): cdef public int __id__ cdef public unsigned long id @@ -993,6 +1091,19 @@ cdef class Zustand(PyMessage): self.state = state +cdef class BatchMeta(PyMessage): + cdef public int __id__ + cdef public unsigned long page_no + cdef public unsigned long first_index + cdef public long timestamp + + def __init__(self, unsigned long page_no, unsigned long first_index, long timestamp): + self.__id__ = 80 + self.page_no = page_no + self.first_index = first_index + self.timestamp = timestamp + + cdef class BatchMetadata(PyMessage): cdef public int __id__ cdef public unsigned long version diff --git a/ee/connectors/msgcodec/msgcodec.py b/ee/connectors/msgcodec/msgcodec.py index 7bc5a8174..6d771b559 100644 --- a/ee/connectors/msgcodec/msgcodec.py +++ b/ee/connectors/msgcodec/msgcodec.py @@ -118,6 +118,11 @@ class MessageCodec(Codec): user_id=self.read_string(reader) ) + if message_id == 3: + return SessionEndDeprecated( + timestamp=self.read_uint(reader) + ) + if message_id == 4: return SetPageLocationDeprecated( url=self.read_string(reader), @@ -265,6 +270,13 @@ class MessageCodec(Codec): time_to_interactive=self.read_uint(reader) ) + if message_id == 25: + return JSExceptionDeprecated( + name=self.read_string(reader), + message=self.read_string(reader), + payload=self.read_string(reader) + ) + if message_id == 26: return IntegrationEvent( timestamp=self.read_uint(reader), @@ -348,17 +360,28 @@ class MessageCodec(Codec): web_vitals=self.read_string(reader) ) - if message_id == 34: - return StringDictGlobal( - key=self.read_uint(reader), - value=self.read_string(reader) + if message_id == 37: + return CSSInsertRule( + id=self.read_uint(reader), + rule=self.read_string(reader), + index=self.read_uint(reader) ) - if message_id == 35: - return SetNodeAttributeDictGlobal( + if message_id == 38: + return CSSDeleteRule( id=self.read_uint(reader), - name=self.read_uint(reader), - value=self.read_uint(reader) + index=self.read_uint(reader) + ) + + if message_id == 39: + return Fetch( + method=self.read_string(reader), + url=self.read_string(reader), + request=self.read_string(reader), + response=self.read_string(reader), + status=self.read_uint(reader), + timestamp=self.read_uint(reader), + duration=self.read_uint(reader) ) if message_id == 40: @@ -503,6 +526,17 @@ class MessageCodec(Codec): id=self.read_int(reader) ) + if message_id == 59: + return LongTask( + timestamp=self.read_uint(reader), + duration=self.read_uint(reader), + context=self.read_uint(reader), + container_type=self.read_uint(reader), + container_src=self.read_string(reader), + container_id=self.read_string(reader), + container_name=self.read_string(reader) + ) + if message_id == 60: return SetNodeAttributeURLBased( id=self.read_uint(reader), @@ -518,6 +552,16 @@ class MessageCodec(Codec): base_url=self.read_string(reader) ) + if message_id == 62: + return IssueEventDeprecated( + message_id=self.read_uint(reader), + timestamp=self.read_uint(reader), + type=self.read_string(reader), + context_string=self.read_string(reader), + context=self.read_string(reader), + payload=self.read_string(reader) + ) + if message_id == 63: return TechnicalInfo( type=self.read_string(reader), @@ -535,6 +579,14 @@ class MessageCodec(Codec): url=self.read_string(reader) ) + if message_id == 67: + return CSSInsertRuleURLBased( + id=self.read_uint(reader), + rule=self.read_string(reader), + index=self.read_uint(reader), + base_url=self.read_string(reader) + ) + if message_id == 68: return MouseClick( id=self.read_uint(reader), @@ -619,6 +671,13 @@ class MessageCodec(Codec): state=self.read_string(reader) ) + if message_id == 80: + return BatchMeta( + page_no=self.read_uint(reader), + first_index=self.read_uint(reader), + timestamp=self.read_int(reader) + ) + if message_id == 81: return BatchMetadata( version=self.read_uint(reader), diff --git a/ee/connectors/msgcodec/msgcodec.pyx b/ee/connectors/msgcodec/msgcodec.pyx index e53fd9224..9055ca0d7 100644 --- a/ee/connectors/msgcodec/msgcodec.pyx +++ b/ee/connectors/msgcodec/msgcodec.pyx @@ -216,6 +216,11 @@ cdef class MessageCodec: user_id=self.read_string(reader) ) + if message_id == 3: + return SessionEndDeprecated( + timestamp=self.read_uint(reader) + ) + if message_id == 4: return SetPageLocationDeprecated( url=self.read_string(reader), @@ -363,6 +368,13 @@ cdef class MessageCodec: time_to_interactive=self.read_uint(reader) ) + if message_id == 25: + return JSExceptionDeprecated( + name=self.read_string(reader), + message=self.read_string(reader), + payload=self.read_string(reader) + ) + if message_id == 26: return IntegrationEvent( timestamp=self.read_uint(reader), @@ -446,17 +458,28 @@ cdef class MessageCodec: web_vitals=self.read_string(reader) ) - if message_id == 34: - return StringDictGlobal( - key=self.read_uint(reader), - value=self.read_string(reader) + if message_id == 37: + return CSSInsertRule( + id=self.read_uint(reader), + rule=self.read_string(reader), + index=self.read_uint(reader) ) - if message_id == 35: - return SetNodeAttributeDictGlobal( + if message_id == 38: + return CSSDeleteRule( id=self.read_uint(reader), - name=self.read_uint(reader), - value=self.read_uint(reader) + index=self.read_uint(reader) + ) + + if message_id == 39: + return Fetch( + method=self.read_string(reader), + url=self.read_string(reader), + request=self.read_string(reader), + response=self.read_string(reader), + status=self.read_uint(reader), + timestamp=self.read_uint(reader), + duration=self.read_uint(reader) ) if message_id == 40: @@ -601,6 +624,17 @@ cdef class MessageCodec: id=self.read_int(reader) ) + if message_id == 59: + return LongTask( + timestamp=self.read_uint(reader), + duration=self.read_uint(reader), + context=self.read_uint(reader), + container_type=self.read_uint(reader), + container_src=self.read_string(reader), + container_id=self.read_string(reader), + container_name=self.read_string(reader) + ) + if message_id == 60: return SetNodeAttributeURLBased( id=self.read_uint(reader), @@ -616,6 +650,16 @@ cdef class MessageCodec: base_url=self.read_string(reader) ) + if message_id == 62: + return IssueEventDeprecated( + message_id=self.read_uint(reader), + timestamp=self.read_uint(reader), + type=self.read_string(reader), + context_string=self.read_string(reader), + context=self.read_string(reader), + payload=self.read_string(reader) + ) + if message_id == 63: return TechnicalInfo( type=self.read_string(reader), @@ -633,6 +677,14 @@ cdef class MessageCodec: url=self.read_string(reader) ) + if message_id == 67: + return CSSInsertRuleURLBased( + id=self.read_uint(reader), + rule=self.read_string(reader), + index=self.read_uint(reader), + base_url=self.read_string(reader) + ) + if message_id == 68: return MouseClick( id=self.read_uint(reader), @@ -717,6 +769,13 @@ cdef class MessageCodec: state=self.read_string(reader) ) + if message_id == 80: + return BatchMeta( + page_no=self.read_uint(reader), + first_index=self.read_uint(reader), + timestamp=self.read_int(reader) + ) + if message_id == 81: return BatchMetadata( version=self.read_uint(reader), diff --git a/frontend/app/player/web/messages/RawMessageReader.gen.ts b/frontend/app/player/web/messages/RawMessageReader.gen.ts index ac31dea9a..09ec883f8 100644 --- a/frontend/app/player/web/messages/RawMessageReader.gen.ts +++ b/frontend/app/player/web/messages/RawMessageReader.gen.ts @@ -255,6 +255,48 @@ export default class RawMessageReader extends PrimitiveReader { }; } + case 37: { + const id = this.readUint(); if (id === null) { return resetPointer() } + const rule = this.readString(); if (rule === null) { return resetPointer() } + const index = this.readUint(); if (index === null) { return resetPointer() } + return { + tp: MType.CssInsertRule, + id, + rule, + index, + }; + } + + case 38: { + const id = this.readUint(); if (id === null) { return resetPointer() } + const index = this.readUint(); if (index === null) { return resetPointer() } + return { + tp: MType.CssDeleteRule, + id, + index, + }; + } + + case 39: { + const method = this.readString(); if (method === null) { return resetPointer() } + const url = this.readString(); if (url === null) { return resetPointer() } + const request = this.readString(); if (request === null) { return resetPointer() } + const response = this.readString(); if (response === null) { return resetPointer() } + const status = this.readUint(); if (status === null) { return resetPointer() } + const timestamp = this.readUint(); if (timestamp === null) { return resetPointer() } + const duration = this.readUint(); if (duration === null) { return resetPointer() } + return { + tp: MType.Fetch, + method, + url, + request, + response, + status, + timestamp, + duration, + }; + } + case 40: { const name = this.readString(); if (name === null) { return resetPointer() } const duration = this.readUint(); if (duration === null) { return resetPointer() } @@ -459,6 +501,26 @@ export default class RawMessageReader extends PrimitiveReader { }; } + case 59: { + const timestamp = this.readUint(); if (timestamp === null) { return resetPointer() } + const duration = this.readUint(); if (duration === null) { return resetPointer() } + const context = this.readUint(); if (context === null) { return resetPointer() } + const containerType = this.readUint(); if (containerType === null) { return resetPointer() } + const containerSrc = this.readString(); if (containerSrc === null) { return resetPointer() } + const containerId = this.readString(); if (containerId === null) { return resetPointer() } + const containerName = this.readString(); if (containerName === null) { return resetPointer() } + return { + tp: MType.LongTask, + timestamp, + duration, + context, + containerType, + containerSrc, + containerId, + containerName, + }; + } + case 60: { const id = this.readUint(); if (id === null) { return resetPointer() } const name = this.readString(); if (name === null) { return resetPointer() } @@ -485,6 +547,20 @@ export default class RawMessageReader extends PrimitiveReader { }; } + case 67: { + const id = this.readUint(); if (id === null) { return resetPointer() } + const rule = this.readString(); if (rule === null) { return resetPointer() } + const index = this.readUint(); if (index === null) { return resetPointer() } + const baseURL = this.readString(); if (baseURL === null) { return resetPointer() } + return { + tp: MType.CssInsertRuleURLBased, + id, + rule, + index, + baseURL, + }; + } + case 68: { const id = this.readUint(); if (id === null) { return resetPointer() } const hesitationTime = this.readUint(); if (hesitationTime === null) { return resetPointer() } diff --git a/frontend/app/player/web/messages/filters.gen.ts b/frontend/app/player/web/messages/filters.gen.ts index 13580e7a8..57708b1b4 100644 --- a/frontend/app/player/web/messages/filters.gen.ts +++ b/frontend/app/player/web/messages/filters.gen.ts @@ -7,8 +7,8 @@ const IOS_TYPES = [ 110, 111, ]; const DOM_TYPES = [ - 0, 4, 5, 6, 7, 8, 9, 10, 11, 12, 13, 14, 15, 16, 18, 19, 20, 34, 35, 49, 50, - 51, 43, 52, 54, 55, 57, 58, 60, 61, 68, 69, 70, 71, 72, 73, 74, 75, 76, 77, + 0, 4, 5, 6, 7, 8, 9, 10, 11, 12, 13, 14, 15, 16, 18, 19, 20, 34, 35, 37,38,49, 50, + 51, 43, 52, 54, 55, 57, 58, 59,60, 61, 67,68, 69, 70, 71, 72, 73, 74, 75, 76, 77, 113, 114, 117, 118, 119, 122, ]; export function isDOMType(t: MType) { diff --git a/frontend/app/player/web/messages/message.gen.ts b/frontend/app/player/web/messages/message.gen.ts index e978d508c..bef4fec85 100644 --- a/frontend/app/player/web/messages/message.gen.ts +++ b/frontend/app/player/web/messages/message.gen.ts @@ -24,6 +24,9 @@ import type { RawConsoleLog, RawStringDictGlobal, RawSetNodeAttributeDictGlobal, + RawCssInsertRule, + RawCssDeleteRule, + RawFetch, RawProfiler, RawOTable, RawReduxDeprecated, @@ -41,8 +44,10 @@ import type { RawSetPageVisibility, RawLoadFontFace, RawSetNodeFocus, + RawLongTask, RawSetNodeAttributeURLBased, RawSetCssDataURLBased, + RawCssInsertRuleURLBased, RawMouseClick, RawMouseClickDeprecated, RawCreateIFrameDocument, @@ -124,6 +129,12 @@ export type SetNodeAttributeDictGlobal = RawSetNodeAttributeDictGlobal & Timed; export type CssInsertRule = RawCssInsertRule & Timed; +export type CssInsertRule = RawCssInsertRule & Timed + +export type CssDeleteRule = RawCssDeleteRule & Timed + +export type Fetch = RawFetch & Timed + export type Profiler = RawProfiler & Timed export type ReduxDeprecated = RawReduxDeprecated & Timed; @@ -159,10 +170,14 @@ export type SetNodeFocus = RawSetNodeFocus & Timed; export type LongTask = RawLongTask & Timed; +export type LongTask = RawLongTask & Timed + export type SetNodeAttributeURLBased = RawSetNodeAttributeURLBased & Timed export type CssInsertRuleURLBased = RawCssInsertRuleURLBased & Timed; +export type CssInsertRuleURLBased = RawCssInsertRuleURLBased & Timed + export type MouseClick = RawMouseClick & Timed export type CreateIFrameDocument = RawCreateIFrameDocument & Timed; diff --git a/frontend/app/player/web/messages/raw.gen.ts b/frontend/app/player/web/messages/raw.gen.ts index 56d643e9b..9331f160e 100644 --- a/frontend/app/player/web/messages/raw.gen.ts +++ b/frontend/app/player/web/messages/raw.gen.ts @@ -22,6 +22,9 @@ export const enum MType { ConsoleLog = 22, StringDictGlobal = 34, SetNodeAttributeDictGlobal = 35, + CssInsertRule = 37, + CssDeleteRule = 38, + Fetch = 39, Profiler = 40, OTable = 41, ReduxDeprecated = 44, @@ -39,8 +42,10 @@ export const enum MType { SetPageVisibility = 55, LoadFontFace = 57, SetNodeFocus = 58, + LongTask = 59, SetNodeAttributeURLBased = 60, SetCssDataURLBased = 61, + CssInsertRuleURLBased = 67, MouseClick = 68, MouseClickDeprecated = 69, CreateIFrameDocument = 70, @@ -214,6 +219,30 @@ export interface RawSetNodeAttributeDictGlobal { value: number; } +export interface RawCssInsertRule { + tp: MType.CssInsertRule, + id: number, + rule: string, + index: number, +} + +export interface RawCssDeleteRule { + tp: MType.CssDeleteRule, + id: number, + index: number, +} + +export interface RawFetch { + tp: MType.Fetch, + method: string, + url: string, + request: string, + response: string, + status: number, + timestamp: number, + duration: number, +} + export interface RawProfiler { tp: MType.Profiler; name: string; @@ -333,6 +362,17 @@ export interface RawSetNodeFocus { id: number; } +export interface RawLongTask { + tp: MType.LongTask, + timestamp: number, + duration: number, + context: number, + containerType: number, + containerSrc: string, + containerId: string, + containerName: string, +} + export interface RawSetNodeAttributeURLBased { tp: MType.SetNodeAttributeURLBased; id: number; @@ -348,6 +388,14 @@ export interface RawSetCssDataURLBased { baseURL: string; } +export interface RawCssInsertRuleURLBased { + tp: MType.CssInsertRuleURLBased, + id: number, + rule: string, + index: number, + baseURL: string, +} + export interface RawMouseClick { tp: MType.MouseClick; id: number; @@ -611,4 +659,4 @@ export interface RawMobileIssueEvent { } -export type RawMessage = RawTimestamp | RawSetPageLocationDeprecated | RawSetViewportSize | RawSetViewportScroll | RawCreateDocument | RawCreateElementNode | RawCreateTextNode | RawMoveNode | RawRemoveNode | RawSetNodeAttribute | RawRemoveNodeAttribute | RawSetNodeData | RawSetCssData | RawSetNodeScroll | RawSetInputValue | RawSetInputChecked | RawMouseMove | RawNetworkRequestDeprecated | RawConsoleLog | RawStringDictGlobal | RawSetNodeAttributeDictGlobal | RawProfiler | RawOTable | RawReduxDeprecated | RawVuex | RawMobX | RawNgRx | RawGraphQlDeprecated | RawPerformanceTrack | RawStringDictDeprecated | RawSetNodeAttributeDictDeprecated | RawStringDict | RawSetNodeAttributeDict | RawResourceTimingDeprecated | RawConnectionInformation | RawSetPageVisibility | RawLoadFontFace | RawSetNodeFocus | RawSetNodeAttributeURLBased | RawSetCssDataURLBased | RawMouseClick | RawMouseClickDeprecated | RawCreateIFrameDocument | RawAdoptedSsReplaceURLBased | RawAdoptedSsReplace | RawAdoptedSsInsertRuleURLBased | RawAdoptedSsInsertRule | RawAdoptedSsDeleteRule | RawAdoptedSsAddOwner | RawAdoptedSsRemoveOwner | RawZustand | RawNetworkRequest | RawWsChannel | RawSelectionChange | RawMouseThrashing | RawResourceTiming | RawTabChange | RawTabData | RawCanvasNode | RawTagTrigger | RawRedux | RawSetPageLocation | RawGraphQl | RawMobileEvent | RawMobileScreenChanges | RawMobileClickEvent | RawMobileInputEvent | RawMobilePerformanceEvent | RawMobileLog | RawMobileInternalError | RawMobileNetworkCall | RawMobileSwipeEvent | RawMobileIssueEvent; +export type RawMessage = RawTimestamp | RawSetPageLocationDeprecated | RawSetViewportSize | RawSetViewportScroll | RawCreateDocument | RawCreateElementNode | RawCreateTextNode | RawMoveNode | RawRemoveNode | RawSetNodeAttribute | RawRemoveNodeAttribute | RawSetNodeData | RawSetCssData | RawSetNodeScroll | RawSetInputValue | RawSetInputChecked | RawMouseMove | RawNetworkRequestDeprecated | RawConsoleLog | RawStringDictGlobal | RawSetNodeAttributeDictGlobal | RawCssInsertRule | RawCssDeleteRule | RawFetch | RawProfiler | RawOTable | RawReduxDeprecated | RawVuex | RawMobX | RawNgRx | RawGraphQlDeprecated | RawPerformanceTrack | RawStringDictDeprecated | RawSetNodeAttributeDictDeprecated | RawStringDict | RawSetNodeAttributeDict | RawResourceTimingDeprecated | RawConnectionInformation | RawSetPageVisibility | RawLoadFontFace | RawSetNodeFocus | RawLongTask | RawSetNodeAttributeURLBased | RawSetCssDataURLBased | RawCssInsertRuleURLBased | RawMouseClick | RawMouseClickDeprecated | RawCreateIFrameDocument | RawAdoptedSsReplaceURLBased | RawAdoptedSsReplace | RawAdoptedSsInsertRuleURLBased | RawAdoptedSsInsertRule | RawAdoptedSsDeleteRule | RawAdoptedSsAddOwner | RawAdoptedSsRemoveOwner | RawZustand | RawNetworkRequest | RawWsChannel | RawSelectionChange | RawMouseThrashing | RawResourceTiming | RawTabChange | RawTabData | RawCanvasNode | RawTagTrigger | RawRedux | RawSetPageLocation | RawGraphQl | RawMobileEvent | RawMobileScreenChanges | RawMobileClickEvent | RawMobileInputEvent | RawMobilePerformanceEvent | RawMobileLog | RawMobileInternalError | RawMobileNetworkCall | RawMobileSwipeEvent | RawMobileIssueEvent; diff --git a/frontend/app/player/web/messages/tracker-legacy.gen.ts b/frontend/app/player/web/messages/tracker-legacy.gen.ts index 6504c4c63..48137b60d 100644 --- a/frontend/app/player/web/messages/tracker-legacy.gen.ts +++ b/frontend/app/player/web/messages/tracker-legacy.gen.ts @@ -24,6 +24,9 @@ export const TP_MAP = { 22: MType.ConsoleLog, 34: MType.StringDictGlobal, 35: MType.SetNodeAttributeDictGlobal, + 37: MType.CssInsertRule, + 38: MType.CssDeleteRule, + 39: MType.Fetch, 40: MType.Profiler, 41: MType.OTable, 44: MType.ReduxDeprecated, @@ -41,8 +44,10 @@ export const TP_MAP = { 55: MType.SetPageVisibility, 57: MType.LoadFontFace, 58: MType.SetNodeFocus, + 59: MType.LongTask, 60: MType.SetNodeAttributeURLBased, 61: MType.SetCssDataURLBased, + 67: MType.CssInsertRuleURLBased, 68: MType.MouseClick, 69: MType.MouseClickDeprecated, 70: MType.CreateIFrameDocument, diff --git a/frontend/app/player/web/messages/tracker.gen.ts b/frontend/app/player/web/messages/tracker.gen.ts index 40fcba5a7..6643e266a 100644 --- a/frontend/app/player/web/messages/tracker.gen.ts +++ b/frontend/app/player/web/messages/tracker.gen.ts @@ -100,6 +100,30 @@ type TrSetNodeAttributeDictGlobal = [ value: number, ]; +type TrCSSInsertRule = [ + type: 37, + id: number, + rule: string, + index: number, +] + +type TrCSSDeleteRule = [ + type: 38, + id: number, + index: number, +] + +type TrFetch = [ + type: 39, + method: string, + url: string, + request: string, + response: string, + status: number, + timestamp: number, + duration: number, +] + type TrProfiler = [ type: 40, name: string, @@ -186,6 +210,17 @@ type TrLoadFontFace = [ type TrSetNodeFocus = [type: 58, id: number]; +type TrLongTask = [ + type: 59, + timestamp: number, + duration: number, + context: number, + containerType: number, + containerSrc: string, + containerId: string, + containerName: string, +] + type TrSetNodeAttributeURLBased = [ type: 60, id: number, @@ -205,6 +240,14 @@ type TrTechnicalInfo = [type: 63, type: string, value: string]; type TrCustomIssue = [type: 64, name: string, payload: string]; +type TrCSSInsertRuleURLBased = [ + type: 67, + id: number, + rule: string, + index: number, + baseURL: string, +] + type TrMouseClick = [ type: 68, id: number, @@ -361,7 +404,7 @@ type TrGraphQL = [ type TrWebVitals = [type: 124, name: string, value: string]; -export type TrackerMessage = TrTimestamp | TrSetPageLocationDeprecated | TrSetViewportSize | TrSetViewportScroll | TrCreateDocument | TrCreateElementNode | TrCreateTextNode | TrMoveNode | TrRemoveNode | TrSetNodeAttribute | TrRemoveNodeAttribute | TrSetNodeData | TrSetNodeScroll | TrSetInputTarget | TrSetInputValue | TrSetInputChecked | TrMouseMove | TrNetworkRequestDeprecated | TrConsoleLog | TrPageLoadTiming | TrPageRenderTiming | TrCustomEvent | TrUserID | TrUserAnonymousID | TrMetadata | TrStringDictGlobal | TrSetNodeAttributeDictGlobal | TrProfiler | TrOTable | TrStateAction | TrReduxDeprecated | TrVuex | TrMobX | TrNgRx | TrGraphQLDeprecated | TrPerformanceTrack | TrStringDictDeprecated | TrSetNodeAttributeDictDeprecated | TrStringDict | TrSetNodeAttributeDict | TrResourceTimingDeprecated | TrConnectionInformation | TrSetPageVisibility | TrLoadFontFace | TrSetNodeFocus | TrSetNodeAttributeURLBased | TrSetCSSDataURLBased | TrTechnicalInfo | TrCustomIssue | TrMouseClick | TrMouseClickDeprecated | TrCreateIFrameDocument | TrAdoptedSSReplaceURLBased | TrAdoptedSSInsertRuleURLBased | TrAdoptedSSDeleteRule | TrAdoptedSSAddOwner | TrAdoptedSSRemoveOwner | TrJSException | TrZustand | TrBatchMetadata | TrPartitionedMessage | TrNetworkRequest | TrWSChannel | TrInputChange | TrSelectionChange | TrMouseThrashing | TrUnbindNodes | TrResourceTiming | TrTabChange | TrTabData | TrCanvasNode | TrTagTrigger | TrRedux | TrSetPageLocation | TrGraphQL | TrWebVitals +export type TrackerMessage = TrTimestamp | TrSetPageLocationDeprecated | TrSetViewportSize | TrSetViewportScroll | TrCreateDocument | TrCreateElementNode | TrCreateTextNode | TrMoveNode | TrRemoveNode | TrSetNodeAttribute | TrRemoveNodeAttribute | TrSetNodeData | TrSetNodeScroll | TrSetInputTarget | TrSetInputValue | TrSetInputChecked | TrMouseMove | TrNetworkRequestDeprecated | TrConsoleLog | TrPageLoadTiming | TrPageRenderTiming | TrCustomEvent | TrUserID | TrUserAnonymousID | TrMetadata | TrStringDictGlobal | TrSetNodeAttributeDictGlobal | TrCSSInsertRule | TrCSSDeleteRule | TrFetch | TrProfiler | TrOTable | TrStateAction | TrReduxDeprecated | TrVuex | TrMobX | TrNgRx | TrGraphQLDeprecated | TrPerformanceTrack | TrStringDictDeprecated | TrSetNodeAttributeDictDeprecated | TrStringDict | TrSetNodeAttributeDict | TrResourceTimingDeprecated | TrConnectionInformation | TrSetPageVisibility | TrLoadFontFace | TrSetNodeFocus | TrLongTask | TrSetNodeAttributeURLBased | TrSetCSSDataURLBased | TrTechnicalInfo | TrCustomIssue | TrCSSInsertRuleURLBased | TrMouseClick | TrMouseClickDeprecated | TrCreateIFrameDocument | TrAdoptedSSReplaceURLBased | TrAdoptedSSInsertRuleURLBased | TrAdoptedSSDeleteRule | TrAdoptedSSAddOwner | TrAdoptedSSRemoveOwner | TrJSException | TrZustand | TrBatchMetadata | TrPartitionedMessage | TrNetworkRequest | TrWSChannel | TrInputChange | TrSelectionChange | TrMouseThrashing | TrUnbindNodes | TrResourceTiming | TrTabChange | TrTabData | TrCanvasNode | TrTagTrigger | TrRedux | TrSetPageLocation | TrGraphQL | TrWebVitals export default function translate(tMsg: TrackerMessage): RawMessage | null { switch (tMsg[0]) { @@ -537,6 +580,36 @@ export default function translate(tMsg: TrackerMessage): RawMessage | null { }; } + case 37: { + return { + tp: MType.CssInsertRule, + id: tMsg[1], + rule: tMsg[2], + index: tMsg[3], + } + } + + case 38: { + return { + tp: MType.CssDeleteRule, + id: tMsg[1], + index: tMsg[2], + } + } + + case 39: { + return { + tp: MType.Fetch, + method: tMsg[1], + url: tMsg[2], + request: tMsg[3], + response: tMsg[4], + status: tMsg[5], + timestamp: tMsg[6], + duration: tMsg[7], + } + } + case 40: { return { tp: MType.Profiler, @@ -690,6 +763,19 @@ export default function translate(tMsg: TrackerMessage): RawMessage | null { }; } + case 59: { + return { + tp: MType.LongTask, + timestamp: tMsg[1], + duration: tMsg[2], + context: tMsg[3], + containerType: tMsg[4], + containerSrc: tMsg[5], + containerId: tMsg[6], + containerName: tMsg[7], + } + } + case 60: { return { tp: MType.SetNodeAttributeURLBased, @@ -709,6 +795,16 @@ export default function translate(tMsg: TrackerMessage): RawMessage | null { }; } + case 67: { + return { + tp: MType.CssInsertRuleURLBased, + id: tMsg[1], + rule: tMsg[2], + index: tMsg[3], + baseURL: tMsg[4], + } + } + case 68: { return { tp: MType.MouseClick, diff --git a/mobs/messages.rb b/mobs/messages.rb index ebf4fe378..3f9dfc827 100644 --- a/mobs/messages.rb +++ b/mobs/messages.rb @@ -22,6 +22,11 @@ message 1, 'SessionStart', :tracker => false, :replayer => false do string 'UserID' end +# DEPRECATED; backend only (TODO: remove in the next release) +message 3, 'SessionEndDeprecated', :tracker => false, :replayer => false do + uint 'Timestamp' +end + # DEPRECATED since 14.0.0 -> goto 122 message 4, 'SetPageLocationDeprecated' do string 'URL' @@ -129,6 +134,12 @@ message 24, 'PageRenderTiming', :replayer => false do uint 'VisuallyComplete' uint 'TimeToInteractive' end +# DEPRECATED since 4.1.6 / 1.8.2 in favor of #78 +message 25, 'JSExceptionDeprecated', :replayer => false, :tracker => false do + string 'Name' + string 'Message' + string 'Payload' +end message 26, 'IntegrationEvent', :tracker => false, :replayer => false do uint 'Timestamp' string 'Source' @@ -208,6 +219,29 @@ message 35, 'SetNodeAttributeDictGlobal' do uint 'Name' uint 'Value' end + +# DEPRECATED since 4.0.2 in favor of AdoptedSSInsertRule + AdoptedSSAddOwner +message 37, 'CSSInsertRule' do + uint 'ID' + string 'Rule' + uint 'Index' +end +# DEPRECATED since 4.0.2 +message 38, 'CSSDeleteRule' do + uint 'ID' + uint 'Index' +end + +# DEPRECATED since 4.1.10 in favor of NetworkRequest +message 39, 'Fetch', :replayer => :devtools do + string 'Method' + string 'URL' + string 'Request' + string 'Response' + uint 'Status' + uint 'Timestamp' + uint 'Duration' +end message 40, 'Profiler', :replayer => :devtools do string 'Name' uint 'Duration' @@ -308,8 +342,9 @@ message 56, 'PerformanceTrackAggr', :tracker => false, :replayer => false do uint 'AvgUsedJSHeapSize' uint 'MaxUsedJSHeapSize' end + # Since 4.1.7 / 1.9.0 -message 57, 'LoadFontFace' do +message 57, 'LoadFontFace' do uint 'ParentID' string 'Family' string 'Source' @@ -319,6 +354,17 @@ end message 58, 'SetNodeFocus' do int 'ID' end + +#DEPRECATED (since 3.0.?) +message 59, 'LongTask' do + uint 'Timestamp' + uint 'Duration' + uint 'Context' + uint 'ContainerType' + string 'ContainerSrc' + string 'ContainerId' + string 'ContainerName' +end message 60, 'SetNodeAttributeURLBased' do uint 'ID' string 'Name' @@ -331,6 +377,15 @@ message 61, 'SetCSSDataURLBased' do string 'Data' string 'BaseURL' end +# DEPRECATED; backend only (TODO: remove in the next release) +message 62, 'IssueEventDeprecated', :replayer => false, :tracker => false do + uint 'MessageID' + uint 'Timestamp' + string 'Type' + string 'ContextString' + string 'Context' + string 'Payload' +end message 63, 'TechnicalInfo', :replayer => false do string 'Type' string 'Value' @@ -343,6 +398,13 @@ end message 66, 'AssetCache', :replayer => false, :tracker => false do string 'URL' end +message 67, 'CSSInsertRuleURLBased' do + uint 'ID' + string 'Rule' + uint 'Index' + string 'BaseURL' +end + message 68, 'MouseClick' do uint 'ID' uint 'HesitationTime' @@ -351,6 +413,7 @@ message 68, 'MouseClick' do uint 'NormalizedX' uint 'NormalizedY' end + message 69, 'MouseClickDeprecated' do uint 'ID' uint 'HesitationTime' @@ -414,6 +477,13 @@ end # Special one for Batch Metadata. Message id could define the version +# DEPRECATED since tracker 3.6.0 in favor of BatchMetadata +message 80, 'BatchMeta', :replayer => false, :tracker => false do + uint 'PageNo' + uint 'FirstIndex' + int 'Timestamp' +end + # since tracker 3.6.0 TODO: for webworker only message 81, 'BatchMetadata', :replayer => false do uint 'Version' diff --git a/tracker/tracker/src/common/messages.gen.ts b/tracker/tracker/src/common/messages.gen.ts index 3921f97a6..0911a99b4 100644 --- a/tracker/tracker/src/common/messages.gen.ts +++ b/tracker/tracker/src/common/messages.gen.ts @@ -29,6 +29,9 @@ export declare const enum Type { Metadata = 30, StringDictGlobal = 34, SetNodeAttributeDictGlobal = 35, + CSSInsertRule = 37, + CSSDeleteRule = 38, + Fetch = 39, Profiler = 40, OTable = 41, StateAction = 42, @@ -47,10 +50,12 @@ export declare const enum Type { SetPageVisibility = 55, LoadFontFace = 57, SetNodeFocus = 58, + LongTask = 59, SetNodeAttributeURLBased = 60, SetCSSDataURLBased = 61, TechnicalInfo = 63, CustomIssue = 64, + CSSInsertRuleURLBased = 67, MouseClick = 68, MouseClickDeprecated = 69, CreateIFrameDocument = 70, @@ -262,6 +267,30 @@ export type SetNodeAttributeDictGlobal = [ /*value:*/ number, ] +export type CSSInsertRule = [ + /*type:*/ Type.CSSInsertRule, + /*id:*/ number, + /*rule:*/ string, + /*index:*/ number, +] + +export type CSSDeleteRule = [ + /*type:*/ Type.CSSDeleteRule, + /*id:*/ number, + /*index:*/ number, +] + +export type Fetch = [ + /*type:*/ Type.Fetch, + /*method:*/ string, + /*url:*/ string, + /*request:*/ string, + /*response:*/ string, + /*status:*/ number, + /*timestamp:*/ number, + /*duration:*/ number, +] + export type Profiler = [ /*type:*/ Type.Profiler, /*name:*/ string, @@ -386,6 +415,17 @@ export type SetNodeFocus = [ /*id:*/ number, ] +export type LongTask = [ + /*type:*/ Type.LongTask, + /*timestamp:*/ number, + /*duration:*/ number, + /*context:*/ number, + /*containerType:*/ number, + /*containerSrc:*/ string, + /*containerId:*/ string, + /*containerName:*/ string, +] + export type SetNodeAttributeURLBased = [ /*type:*/ Type.SetNodeAttributeURLBased, /*id:*/ number, @@ -413,6 +453,14 @@ export type CustomIssue = [ /*payload:*/ string, ] +export type CSSInsertRuleURLBased = [ + /*type:*/ Type.CSSInsertRuleURLBased, + /*id:*/ number, + /*rule:*/ string, + /*index:*/ number, + /*baseURL:*/ string, +] + export type MouseClick = [ /*type:*/ Type.MouseClick, /*id:*/ number, @@ -616,5 +664,5 @@ export type WebVitals = [ ] -type Message = Timestamp | SetPageLocationDeprecated | SetViewportSize | SetViewportScroll | CreateDocument | CreateElementNode | CreateTextNode | MoveNode | RemoveNode | SetNodeAttribute | RemoveNodeAttribute | SetNodeData | SetNodeScroll | SetInputTarget | SetInputValue | SetInputChecked | MouseMove | NetworkRequestDeprecated | ConsoleLog | PageLoadTiming | PageRenderTiming | CustomEvent | UserID | UserAnonymousID | Metadata | StringDictGlobal | SetNodeAttributeDictGlobal | Profiler | OTable | StateAction | ReduxDeprecated | Vuex | MobX | NgRx | GraphQLDeprecated | PerformanceTrack | StringDictDeprecated | SetNodeAttributeDictDeprecated | StringDict | SetNodeAttributeDict | ResourceTimingDeprecated | ConnectionInformation | SetPageVisibility | LoadFontFace | SetNodeFocus | SetNodeAttributeURLBased | SetCSSDataURLBased | TechnicalInfo | CustomIssue | MouseClick | MouseClickDeprecated | CreateIFrameDocument | AdoptedSSReplaceURLBased | AdoptedSSInsertRuleURLBased | AdoptedSSDeleteRule | AdoptedSSAddOwner | AdoptedSSRemoveOwner | JSException | Zustand | BatchMetadata | PartitionedMessage | NetworkRequest | WSChannel | InputChange | SelectionChange | MouseThrashing | UnbindNodes | ResourceTiming | TabChange | TabData | CanvasNode | TagTrigger | Redux | SetPageLocation | GraphQL | WebVitals +type Message = Timestamp | SetPageLocationDeprecated | SetViewportSize | SetViewportScroll | CreateDocument | CreateElementNode | CreateTextNode | MoveNode | RemoveNode | SetNodeAttribute | RemoveNodeAttribute | SetNodeData | SetNodeScroll | SetInputTarget | SetInputValue | SetInputChecked | MouseMove | NetworkRequestDeprecated | ConsoleLog | PageLoadTiming | PageRenderTiming | CustomEvent | UserID | UserAnonymousID | Metadata | StringDictGlobal | SetNodeAttributeDictGlobal | CSSInsertRule | CSSDeleteRule | Fetch | Profiler | OTable | StateAction | ReduxDeprecated | Vuex | MobX | NgRx | GraphQLDeprecated | PerformanceTrack | StringDictDeprecated | SetNodeAttributeDictDeprecated | StringDict | SetNodeAttributeDict | ResourceTimingDeprecated | ConnectionInformation | SetPageVisibility | LoadFontFace | SetNodeFocus | LongTask | SetNodeAttributeURLBased | SetCSSDataURLBased | TechnicalInfo | CustomIssue | CSSInsertRuleURLBased | MouseClick | MouseClickDeprecated | CreateIFrameDocument | AdoptedSSReplaceURLBased | AdoptedSSInsertRuleURLBased | AdoptedSSDeleteRule | AdoptedSSAddOwner | AdoptedSSRemoveOwner | JSException | Zustand | BatchMetadata | PartitionedMessage | NetworkRequest | WSChannel | InputChange | SelectionChange | MouseThrashing | UnbindNodes | ResourceTiming | TabChange | TabData | CanvasNode | TagTrigger | Redux | SetPageLocation | GraphQL | WebVitals export default Message diff --git a/tracker/tracker/src/main/app/messages.gen.ts b/tracker/tracker/src/main/app/messages.gen.ts index ae21e3b9a..ca9a88118 100644 --- a/tracker/tracker/src/main/app/messages.gen.ts +++ b/tracker/tracker/src/main/app/messages.gen.ts @@ -340,6 +340,51 @@ export function SetNodeAttributeDictGlobal( ] } +export function CSSInsertRule( + id: number, + rule: string, + index: number, +): Messages.CSSInsertRule { + return [ + Messages.Type.CSSInsertRule, + id, + rule, + index, + ] +} + +export function CSSDeleteRule( + id: number, + index: number, +): Messages.CSSDeleteRule { + return [ + Messages.Type.CSSDeleteRule, + id, + index, + ] +} + +export function Fetch( + method: string, + url: string, + request: string, + response: string, + status: number, + timestamp: number, + duration: number, +): Messages.Fetch { + return [ + Messages.Type.Fetch, + method, + url, + request, + response, + status, + timestamp, + duration, + ] +} + export function Profiler( name: string, duration: number, @@ -570,6 +615,27 @@ export function SetNodeFocus( ] } +export function LongTask( + timestamp: number, + duration: number, + context: number, + containerType: number, + containerSrc: string, + containerId: string, + containerName: string, +): Messages.LongTask { + return [ + Messages.Type.LongTask, + timestamp, + duration, + context, + containerType, + containerSrc, + containerId, + containerName, + ] +} + export function SetNodeAttributeURLBased( id: number, name: string, @@ -620,6 +686,21 @@ export function CustomIssue( ] } +export function CSSInsertRuleURLBased( + id: number, + rule: string, + index: number, + baseURL: string, +): Messages.CSSInsertRuleURLBased { + return [ + Messages.Type.CSSInsertRuleURLBased, + id, + rule, + index, + baseURL, + ] +} + export function MouseClick( id: number, hesitationTime: number, diff --git a/tracker/tracker/src/webworker/MessageEncoder.gen.ts b/tracker/tracker/src/webworker/MessageEncoder.gen.ts index 88e13eb25..cd8a2b5d3 100644 --- a/tracker/tracker/src/webworker/MessageEncoder.gen.ts +++ b/tracker/tracker/src/webworker/MessageEncoder.gen.ts @@ -118,6 +118,18 @@ export default class MessageEncoder extends PrimitiveEncoder { return this.uint(msg[1]) && this.uint(msg[2]) && this.uint(msg[3]) break + case Messages.Type.CSSInsertRule: + return this.uint(msg[1]) && this.string(msg[2]) && this.uint(msg[3]) + break + + case Messages.Type.CSSDeleteRule: + return this.uint(msg[1]) && this.uint(msg[2]) + break + + case Messages.Type.Fetch: + return this.string(msg[1]) && this.string(msg[2]) && this.string(msg[3]) && this.string(msg[4]) && this.uint(msg[5]) && this.uint(msg[6]) && this.uint(msg[7]) + break + case Messages.Type.Profiler: return this.string(msg[1]) && this.uint(msg[2]) && this.string(msg[3]) && this.string(msg[4]) break @@ -190,6 +202,10 @@ export default class MessageEncoder extends PrimitiveEncoder { return this.int(msg[1]) break + case Messages.Type.LongTask: + return this.uint(msg[1]) && this.uint(msg[2]) && this.uint(msg[3]) && this.uint(msg[4]) && this.string(msg[5]) && this.string(msg[6]) && this.string(msg[7]) + break + case Messages.Type.SetNodeAttributeURLBased: return this.uint(msg[1]) && this.string(msg[2]) && this.string(msg[3]) && this.string(msg[4]) break @@ -206,6 +222,10 @@ export default class MessageEncoder extends PrimitiveEncoder { return this.string(msg[1]) && this.string(msg[2]) break + case Messages.Type.CSSInsertRuleURLBased: + return this.uint(msg[1]) && this.string(msg[2]) && this.uint(msg[3]) && this.string(msg[4]) + break + case Messages.Type.MouseClick: return this.uint(msg[1]) && this.uint(msg[2]) && this.string(msg[3]) && this.string(msg[4]) && this.uint(msg[5]) && this.uint(msg[6]) break