refactor(mobs):update comments, remove deprecated since one release back

This commit is contained in:
Alex Kaminskii 2023-02-03 17:10:05 +01:00
parent 7dec39300f
commit d310ca7bfe
15 changed files with 1724 additions and 1797 deletions

View file

@ -35,7 +35,7 @@ func NewEnderMessageIterator(messageHandler MessageHandler, messageFilter []int,
iter.preFilter = map[int]struct{}{
MsgBatchMetadata: {}, MsgBatchMeta: {}, MsgTimestamp: {},
MsgSessionStart: {}, MsgSessionEnd: {}, MsgSetPageLocation: {},
MsgSessionEndDeprecated: {}}
}
return iter
}

View file

@ -35,7 +35,7 @@ func NewSinkMessageIterator(messageHandler MessageHandler, messageFilter []int,
iter.preFilter = map[int]struct{}{
MsgBatchMetadata: {}, MsgBatchMeta: {}, MsgTimestamp: {},
MsgSessionStart: {}, MsgSessionEnd: {}, MsgSetPageLocation: {},
MsgSessionEndDeprecated: {}}
}
return iter
}

View file

@ -43,7 +43,7 @@ func NewMessageIterator(messageHandler MessageHandler, messageFilter []int, auto
iter.preFilter = map[int]struct{}{
MsgBatchMetadata: {}, MsgBatchMeta: {}, MsgTimestamp: {},
MsgSessionStart: {}, MsgSessionEnd: {}, MsgSetPageLocation: {},
MsgSessionEndDeprecated: {}}
}
return iter
}

View file

@ -9,11 +9,6 @@ func transformDeprecated(msg Message) Message {
Payload: m.Payload,
Metadata: "{}",
}
case *SessionEndDeprecated:
return &SessionEnd{
Timestamp: m.Timestamp,
EncryptionKey: "",
}
case *Fetch:
return &NetworkRequest{
Type: "fetch",

File diff suppressed because it is too large Load diff

File diff suppressed because it is too large Load diff

View file

@ -681,14 +681,6 @@ class AdoptedSSRemoveOwner(Message):
self.id = id
class Zustand(Message):
__id__ = 79
def __init__(self, mutation, state):
self.mutation = mutation
self.state = state
class JSException(Message):
__id__ = 78
@ -699,6 +691,14 @@ class JSException(Message):
self.metadata = metadata
class Zustand(Message):
__id__ = 79
def __init__(self, mutation, state):
self.mutation = mutation
self.state = state
class BatchMeta(Message):
__id__ = 80

View file

@ -611,12 +611,6 @@ class MessageCodec(Codec):
id=self.read_uint(reader)
)
if message_id == 79:
return Zustand(
mutation=self.read_string(reader),
state=self.read_string(reader)
)
if message_id == 78:
return JSException(
name=self.read_string(reader),
@ -625,6 +619,12 @@ class MessageCodec(Codec):
metadata=self.read_string(reader)
)
if message_id == 79:
return Zustand(
mutation=self.read_string(reader),
state=self.read_string(reader)
)
if message_id == 80:
return BatchMeta(
page_no=self.read_uint(reader),

View file

@ -151,13 +151,6 @@ type TrPageRenderTiming = [
timeToInteractive: number,
]
type TrJSExceptionDeprecated = [
type: 25,
name: string,
message: string,
payload: string,
]
type TrCustomEvent = [
type: 27,
name: string,
@ -394,12 +387,6 @@ type TrAdoptedSSRemoveOwner = [
id: number,
]
type TrZustand = [
type: 79,
mutation: string,
state: string,
]
type TrJSException = [
type: 78,
name: string,
@ -408,6 +395,12 @@ type TrJSException = [
metadata: string,
]
type TrZustand = [
type: 79,
mutation: string,
state: string,
]
type TrBatchMetadata = [
type: 81,
version: number,
@ -424,7 +417,7 @@ type TrPartitionedMessage = [
]
export type TrackerMessage = TrTimestamp | TrSetPageLocation | TrSetViewportSize | TrSetViewportScroll | TrCreateDocument | TrCreateElementNode | TrCreateTextNode | TrMoveNode | TrRemoveNode | TrSetNodeAttribute | TrRemoveNodeAttribute | TrSetNodeData | TrSetNodeScroll | TrSetInputTarget | TrSetInputValue | TrSetInputChecked | TrMouseMove | TrNetworkRequest | TrConsoleLog | TrPageLoadTiming | TrPageRenderTiming | TrJSExceptionDeprecated | TrCustomEvent | TrUserID | TrUserAnonymousID | TrMetadata | TrCSSInsertRule | TrCSSDeleteRule | TrFetch | TrProfiler | TrOTable | TrStateAction | TrRedux | TrVuex | TrMobX | TrNgRx | TrGraphQL | TrPerformanceTrack | TrResourceTiming | TrConnectionInformation | TrSetPageVisibility | TrLoadFontFace | TrSetNodeFocus | TrLongTask | TrSetNodeAttributeURLBased | TrSetCSSDataURLBased | TrTechnicalInfo | TrCustomIssue | TrCSSInsertRuleURLBased | TrMouseClick | TrCreateIFrameDocument | TrAdoptedSSReplaceURLBased | TrAdoptedSSInsertRuleURLBased | TrAdoptedSSDeleteRule | TrAdoptedSSAddOwner | TrAdoptedSSRemoveOwner | TrZustand | TrJSException | TrBatchMetadata | TrPartitionedMessage
export type TrackerMessage = TrTimestamp | TrSetPageLocation | TrSetViewportSize | TrSetViewportScroll | TrCreateDocument | TrCreateElementNode | TrCreateTextNode | TrMoveNode | TrRemoveNode | TrSetNodeAttribute | TrRemoveNodeAttribute | TrSetNodeData | TrSetNodeScroll | TrSetInputTarget | TrSetInputValue | TrSetInputChecked | TrMouseMove | TrNetworkRequest | TrConsoleLog | TrPageLoadTiming | TrPageRenderTiming | TrCustomEvent | TrUserID | TrUserAnonymousID | TrMetadata | TrCSSInsertRule | TrCSSDeleteRule | TrFetch | TrProfiler | TrOTable | TrStateAction | TrRedux | TrVuex | TrMobX | TrNgRx | TrGraphQL | TrPerformanceTrack | TrResourceTiming | TrConnectionInformation | TrSetPageVisibility | TrLoadFontFace | TrSetNodeFocus | TrLongTask | TrSetNodeAttributeURLBased | TrSetCSSDataURLBased | TrTechnicalInfo | TrCustomIssue | TrCSSInsertRuleURLBased | TrMouseClick | TrCreateIFrameDocument | TrAdoptedSSReplaceURLBased | TrAdoptedSSInsertRuleURLBased | TrAdoptedSSDeleteRule | TrAdoptedSSAddOwner | TrAdoptedSSRemoveOwner | TrJSException | TrZustand | TrBatchMetadata | TrPartitionedMessage
export default function translate(tMsg: TrackerMessage): RawMessage | null {
switch(tMsg[0]) {

View file

@ -23,6 +23,8 @@ message 1, 'SessionStart', :tracker => false, :replayer => false do
end
## message 2, 'CreateDocument', do
# end
# DEPRECATED; backend only (TODO: remove in the next release)
message 3, 'SessionEndDeprecated', :tracker => false, :replayer => false do
uint 'Timestamp'
end
@ -132,8 +134,8 @@ 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 do
# 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'
@ -192,15 +194,7 @@ message 33, 'ClickEvent', :tracker => false, :replayer => false do
string 'Label'
string 'Selector'
end
# removed (backend-only)
# message 34, 'ErrorEvent', :tracker => false, :replayer => false do
# uint 'MessageID'
# uint 'Timestamp'
# string 'Source'
# string 'Name'
# string 'Message'
# string 'Payload'
# end
## 34
message 35, 'ResourceEvent', :tracker => false, :replayer => false do
uint 'MessageID'
uint 'Timestamp'
@ -215,27 +209,21 @@ message 35, 'ResourceEvent', :tracker => false, :replayer => false do
string 'Method'
uint 'Status'
end
# removed (backend-only)
# message 36, 'CustomEvent', :tracker => false, :replayer => false do
# uint 'MessageID'
# uint 'Timestamp'
# string 'Name'
# string 'Payload'
# end
#36
# deprecated since 4.0.2 in favor of AdoptedSSInsertRule + AdoptedSSAddOwner
# 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
# DEPRECATED since 4.0.2
message 38, 'CSSDeleteRule' do
uint 'ID'
uint 'Index'
end
# deprecated since 4.1.10 in favor of NetworkRequest
# DEPRECATED since 4.1.10 in favor of NetworkRequest
message 39, 'Fetch', :replayer => :devtools do
string 'Method'
string 'URL'
@ -258,12 +246,7 @@ end
message 42, 'StateAction', :replayer => false do
string 'Type'
end
# removed (backend-only)
# message 43, 'StateActionEvent', :tracker => false, :replayer => false do
# uint 'MessageID'
# uint 'Timestamp'
# string 'Type'
# end
## 43
message 44, 'Redux', :replayer => :devtools do
string 'Action'
string 'State'
@ -294,26 +277,8 @@ message 49, 'PerformanceTrack' do #, :replayer => :devtools --> requires player
uint 'TotalJSHeapSize'
uint 'UsedJSHeapSize'
end
# removed (backend-only)
# message 50, 'GraphQLEvent', :tracker => false, :replayer => false do
# uint 'MessageID'
# uint 'Timestamp'
# string 'OperationKind'
# string 'OperationName'
# string 'Variables'
# string 'Response'
# end
# removed (backend-only)
# message 51, 'FetchEvent', :tracker => false, :replayer => false do
# uint 'MessageID'
# uint 'Timestamp'
# string 'Method'
# string 'URL'
# string 'Request'
# string 'Response'
# uint 'Status'
# uint 'Duration'
# end
## 50,51
# Doesn't work properly. TODO: Make proper detections in tracker
message 52, 'DOMDrop', :tracker => false, :replayer => false do
uint 'Timestamp'
end
@ -363,7 +328,7 @@ message 58, 'SetNodeFocus' do
int 'ID'
end
#Deprecated (since 3.0.?)
#DEPRECATED (since 3.0.?)
message 59, 'LongTask' do
uint 'Timestamp'
uint 'Duration'
@ -385,6 +350,7 @@ 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'
@ -459,22 +425,23 @@ message 77, 'AdoptedSSRemoveOwner' do
uint 'SheetID'
uint 'ID'
end
message 79, 'Zustand', :replayer => :devtools do
string 'Mutation'
string 'State'
end
message 78, 'JSException', :replayer => false do
string 'Name'
string 'Message'
string 'Payload'
string 'Metadata'
end
message 79, 'Zustand', :replayer => :devtools do
string 'Mutation'
string 'State'
end
# 80 -- 90 reserved
# Special one for Batch Metadata. Message id could define the version
# Deprecated since tracker 3.6.0 in favor of BatchMetadata
# DEPRECATED since tracker 3.6.0 in favor of BatchMetadata
message 80, 'BatchMeta', :replayer => false, :tracker => false do
uint 'PageNo'
uint 'FirstIndex'
@ -496,6 +463,8 @@ message 82, 'PartitionedMessage', :replayer => false do
uint 'PartTotal'
end
## Backend-only
message 125, 'IssueEvent', :replayer => false, :tracker => false do
uint 'MessageID'
uint 'Timestamp'
@ -505,12 +474,10 @@ message 125, 'IssueEvent', :replayer => false, :tracker => false do
string 'Payload'
string 'URL'
end
message 126, 'SessionEnd', :tracker => false, :replayer => false do
uint 'Timestamp'
string 'EncryptionKey'
end
message 127, 'SessionSearch', :tracker => false, :replayer => false do
uint 'Timestamp'
uint 'Partition'

View file

@ -9,11 +9,11 @@ import PrimitiveEncoder from './PrimitiveEncoder.js'
export default class MessageEncoder extends PrimitiveEncoder {
encode(msg: Message): boolean {
switch(msg[0]) {
<% $messages.select { |msg| msg.tracker }.each do |msg| %>
<% $messages.select { |msg| msg.tracker }.each do |msg| %>
case Messages.Type.<%= msg.name %>:
return <% if msg.attributes.size == 0 %> true <% else %> <%= msg.attributes.map.with_index { |attr, index| "this.#{attr.type}(msg[#{index+1}])" }.join " && " %> <% end %>
return <% if msg.attributes.size == 0 %> true <% else %> <%= msg.attributes.map.with_index { |attr, index| "this.#{attr.type}(msg[#{index+1}])" }.join " && " %><% end %>
break
<% end %>
<% end %>
}
}

View file

@ -23,7 +23,6 @@ export declare const enum Type {
ConsoleLog = 22,
PageLoadTiming = 23,
PageRenderTiming = 24,
JSExceptionDeprecated = 25,
CustomEvent = 27,
UserID = 28,
UserAnonymousID = 29,
@ -58,8 +57,8 @@ export declare const enum Type {
AdoptedSSDeleteRule = 75,
AdoptedSSAddOwner = 76,
AdoptedSSRemoveOwner = 77,
Zustand = 79,
JSException = 78,
Zustand = 79,
BatchMetadata = 81,
PartitionedMessage = 82,
}
@ -211,13 +210,6 @@ export type PageRenderTiming = [
/*timeToInteractive:*/ number,
]
export type JSExceptionDeprecated = [
/*type:*/ Type.JSExceptionDeprecated,
/*name:*/ string,
/*message:*/ string,
/*payload:*/ string,
]
export type CustomEvent = [
/*type:*/ Type.CustomEvent,
/*name:*/ string,
@ -454,12 +446,6 @@ export type AdoptedSSRemoveOwner = [
/*id:*/ number,
]
export type Zustand = [
/*type:*/ Type.Zustand,
/*mutation:*/ string,
/*state:*/ string,
]
export type JSException = [
/*type:*/ Type.JSException,
/*name:*/ string,
@ -468,6 +454,12 @@ export type JSException = [
/*metadata:*/ string,
]
export type Zustand = [
/*type:*/ Type.Zustand,
/*mutation:*/ string,
/*state:*/ string,
]
export type BatchMetadata = [
/*type:*/ Type.BatchMetadata,
/*version:*/ number,
@ -484,5 +476,5 @@ export type PartitionedMessage = [
]
type Message = Timestamp | SetPageLocation | SetViewportSize | SetViewportScroll | CreateDocument | CreateElementNode | CreateTextNode | MoveNode | RemoveNode | SetNodeAttribute | RemoveNodeAttribute | SetNodeData | SetNodeScroll | SetInputTarget | SetInputValue | SetInputChecked | MouseMove | NetworkRequest | ConsoleLog | PageLoadTiming | PageRenderTiming | JSExceptionDeprecated | CustomEvent | UserID | UserAnonymousID | Metadata | CSSInsertRule | CSSDeleteRule | Fetch | Profiler | OTable | StateAction | Redux | Vuex | MobX | NgRx | GraphQL | PerformanceTrack | ResourceTiming | ConnectionInformation | SetPageVisibility | LoadFontFace | SetNodeFocus | LongTask | SetNodeAttributeURLBased | SetCSSDataURLBased | TechnicalInfo | CustomIssue | CSSInsertRuleURLBased | MouseClick | CreateIFrameDocument | AdoptedSSReplaceURLBased | AdoptedSSInsertRuleURLBased | AdoptedSSDeleteRule | AdoptedSSAddOwner | AdoptedSSRemoveOwner | Zustand | JSException | BatchMetadata | PartitionedMessage
type Message = Timestamp | SetPageLocation | SetViewportSize | SetViewportScroll | CreateDocument | CreateElementNode | CreateTextNode | MoveNode | RemoveNode | SetNodeAttribute | RemoveNodeAttribute | SetNodeData | SetNodeScroll | SetInputTarget | SetInputValue | SetInputChecked | MouseMove | NetworkRequest | ConsoleLog | PageLoadTiming | PageRenderTiming | CustomEvent | UserID | UserAnonymousID | Metadata | CSSInsertRule | CSSDeleteRule | Fetch | Profiler | OTable | StateAction | Redux | Vuex | MobX | NgRx | GraphQL | PerformanceTrack | ResourceTiming | ConnectionInformation | SetPageVisibility | LoadFontFace | SetNodeFocus | LongTask | SetNodeAttributeURLBased | SetCSSDataURLBased | TechnicalInfo | CustomIssue | CSSInsertRuleURLBased | MouseClick | CreateIFrameDocument | AdoptedSSReplaceURLBased | AdoptedSSInsertRuleURLBased | AdoptedSSDeleteRule | AdoptedSSAddOwner | AdoptedSSRemoveOwner | JSException | Zustand | BatchMetadata | PartitionedMessage
export default Message

View file

@ -276,19 +276,6 @@ export function PageRenderTiming(
]
}
export function JSExceptionDeprecated(
name: string,
message: string,
payload: string,
): Messages.JSExceptionDeprecated {
return [
Messages.Type.JSExceptionDeprecated,
name,
message,
payload,
]
}
export function CustomEvent(
name: string,
payload: string,
@ -727,17 +714,6 @@ export function AdoptedSSRemoveOwner(
]
}
export function Zustand(
mutation: string,
state: string,
): Messages.Zustand {
return [
Messages.Type.Zustand,
mutation,
state,
]
}
export function JSException(
name: string,
message: string,
@ -753,6 +729,17 @@ export function JSException(
]
}
export function Zustand(
mutation: string,
state: string,
): Messages.Zustand {
return [
Messages.Type.Zustand,
mutation,
state,
]
}
export function BatchMetadata(
version: number,
pageNo: number,

View file

@ -94,10 +94,6 @@ export default class MessageEncoder extends PrimitiveEncoder {
return this.uint(msg[1]) && this.uint(msg[2]) && this.uint(msg[3])
break
case Messages.Type.JSExceptionDeprecated:
return this.string(msg[1]) && this.string(msg[2]) && this.string(msg[3])
break
case Messages.Type.CustomEvent:
return this.string(msg[1]) && this.string(msg[2])
break
@ -234,14 +230,14 @@ export default class MessageEncoder extends PrimitiveEncoder {
return this.uint(msg[1]) && this.uint(msg[2])
break
case Messages.Type.Zustand:
return this.string(msg[1]) && this.string(msg[2])
break
case Messages.Type.JSException:
return this.string(msg[1]) && this.string(msg[2]) && this.string(msg[3]) && this.string(msg[4])
break
case Messages.Type.Zustand:
return this.string(msg[1]) && this.string(msg[2])
break
case Messages.Type.BatchMetadata:
return this.uint(msg[1]) && this.uint(msg[2]) && this.uint(msg[3]) && this.int(msg[4]) && this.string(msg[5])
break