new mobile gql message

This commit is contained in:
nick-delirium 2024-12-26 14:45:35 +01:00
parent 53424b4001
commit d91e98ff99
No known key found for this signature in database
GPG key ID: 93ABD695DF5FDBA0
11 changed files with 117 additions and 5 deletions

View file

@ -6,9 +6,9 @@ func IsReplayerType(id int) bool {
}
func IsMobileType(id int) bool {
return 90 == id || 91 == id || 92 == id || 93 == id || 94 == id || 95 == id || 96 == id || 97 == id || 98 == id || 100 == id || 101 == id || 102 == id || 103 == id || 104 == id || 105 == id || 106 == id || 107 == id || 110 == id || 111 == id
return 90 == id || 91 == id || 92 == id || 93 == id || 94 == id || 95 == id || 96 == id || 97 == id || 98 == id || 100 == id || 101 == id || 102 == id || 103 == id || 104 == id || 105 == id || 106 == id || 107 == id || 110 == id || 111 == id || 89 == id
}
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 || 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
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 || 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 || 89 == id
}

View file

@ -58,6 +58,9 @@ func GetTimestamp(message Message) uint64 {
case *MobileIssueEvent:
return msg.Timestamp
case *MobileGraphQL:
return msg.Timestamp
}
return uint64(message.Meta().Timestamp)
}

View file

@ -117,6 +117,7 @@ const (
MsgMobileBatchMeta = 107
MsgMobilePerformanceAggregated = 110
MsgMobileIssueEvent = 111
MsgMobileGraphQL = 89
)
type Timestamp struct {
@ -3210,3 +3211,36 @@ func (msg *MobileIssueEvent) Decode() Message {
func (msg *MobileIssueEvent) TypeID() int {
return 111
}
type MobileGraphQL struct {
message
Timestamp uint64
Length uint64
OperationKind string
OperationName string
Variables string
Response string
Duration uint64
}
func (msg *MobileGraphQL) Encode() []byte {
buf := make([]byte, 71+len(msg.OperationKind)+len(msg.OperationName)+len(msg.Variables)+len(msg.Response))
buf[0] = 89
p := 1
p = WriteUint(msg.Timestamp, buf, p)
p = WriteUint(msg.Length, buf, p)
p = WriteString(msg.OperationKind, buf, p)
p = WriteString(msg.OperationName, buf, p)
p = WriteString(msg.Variables, buf, p)
p = WriteString(msg.Response, buf, p)
p = WriteUint(msg.Duration, buf, p)
return buf[:p]
}
func (msg *MobileGraphQL) Decode() Message {
return msg
}
func (msg *MobileGraphQL) TypeID() int {
return 89
}

View file

@ -2055,6 +2055,33 @@ func DecodeMobileIssueEvent(reader BytesReader) (Message, error) {
return msg, err
}
func DecodeMobileGraphQL(reader BytesReader) (Message, error) {
var err error = nil
msg := &MobileGraphQL{}
if msg.Timestamp, err = reader.ReadUint(); err != nil {
return nil, err
}
if msg.Length, err = reader.ReadUint(); err != nil {
return nil, err
}
if msg.OperationKind, err = reader.ReadString(); err != nil {
return nil, err
}
if msg.OperationName, err = reader.ReadString(); err != nil {
return nil, err
}
if msg.Variables, err = reader.ReadString(); err != nil {
return nil, err
}
if msg.Response, err = reader.ReadString(); err != nil {
return nil, err
}
if msg.Duration, err = reader.ReadUint(); err != nil {
return nil, err
}
return msg, err
}
func ReadMessage(t uint64, reader BytesReader) (Message, error) {
switch t {
case 0:
@ -2287,6 +2314,8 @@ func ReadMessage(t uint64, reader BytesReader) (Message, error) {
return DecodeMobilePerformanceAggregated(reader)
case 111:
return DecodeMobileIssueEvent(reader)
case 89:
return DecodeMobileGraphQL(reader)
}
return nil, fmt.Errorf("unknown message code: %v", t)
}

View file

@ -997,6 +997,26 @@ export default class RawMessageReader extends PrimitiveReader {
};
}
case 89: {
const timestamp = this.readUint(); if (timestamp === null) { return resetPointer() }
const length = this.readUint(); if (length === null) { return resetPointer() }
const operationKind = this.readString(); if (operationKind === null) { return resetPointer() }
const operationName = this.readString(); if (operationName === null) { return resetPointer() }
const variables = this.readString(); if (variables === null) { return resetPointer() }
const response = this.readString(); if (response === null) { return resetPointer() }
const duration = this.readUint(); if (duration === null) { return resetPointer() }
return {
tp: MType.MobileGraphQl,
timestamp,
length,
operationKind,
operationName,
variables,
response,
duration,
};
}
default:
throw new Error(`Unrecognizable message type: ${ tp }; Pointer at the position ${this.p} of ${this.buf.length}`)
}

View file

@ -3,7 +3,7 @@
import { MType } from './raw.gen'
const IOS_TYPES = [90,91,92,93,94,95,96,97,98,100,101,102,103,104,105,106,107,110,111]
const IOS_TYPES = [90,91,92,93,94,95,96,97,98,100,101,102,103,104,105,106,107,110,111,89]
const DOM_TYPES = [0,4,5,6,7,8,9,10,11,12,13,14,15,16,18,19,20,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) {
return DOM_TYPES.includes(t)

View file

@ -80,6 +80,7 @@ import type {
RawMobileNetworkCall,
RawMobileSwipeEvent,
RawMobileIssueEvent,
RawMobileGraphQl,
} from './raw.gen'
export type Message = RawMessage & Timed
@ -237,3 +238,5 @@ export type MobileSwipeEvent = RawMobileSwipeEvent & Timed
export type MobileIssueEvent = RawMobileIssueEvent & Timed
export type MobileGraphQl = RawMobileGraphQl & Timed

View file

@ -78,6 +78,7 @@ export const enum MType {
MobileNetworkCall = 105,
MobileSwipeEvent = 106,
MobileIssueEvent = 111,
MobileGraphQl = 89,
}
@ -646,5 +647,16 @@ export interface RawMobileIssueEvent {
payload: string,
}
export interface RawMobileGraphQl {
tp: MType.MobileGraphQl,
timestamp: number,
length: number,
operationKind: string,
operationName: string,
variables: string,
response: string,
duration: number,
}
export type RawMessage = RawTimestamp | RawSetPageLocationDeprecated | RawSetViewportSize | RawSetViewportScroll | RawCreateDocument | RawCreateElementNode | RawCreateTextNode | RawMoveNode | RawRemoveNode | RawSetNodeAttribute | RawRemoveNodeAttribute | RawSetNodeData | RawSetCssData | RawSetNodeScroll | RawSetInputValue | RawSetInputChecked | RawMouseMove | RawNetworkRequestDeprecated | RawConsoleLog | 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;
export type RawMessage = RawTimestamp | RawSetPageLocationDeprecated | RawSetViewportSize | RawSetViewportScroll | RawCreateDocument | RawCreateElementNode | RawCreateTextNode | RawMoveNode | RawRemoveNode | RawSetNodeAttribute | RawRemoveNodeAttribute | RawSetNodeData | RawSetCssData | RawSetNodeScroll | RawSetInputValue | RawSetInputChecked | RawMouseMove | RawNetworkRequestDeprecated | RawConsoleLog | 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 | RawMobileGraphQl;

View file

@ -79,4 +79,5 @@ export const TP_MAP = {
105: MType.MobileNetworkCall,
106: MType.MobileSwipeEvent,
111: MType.MobileIssueEvent,
89: MType.MobileGraphQl,
} as const

View file

@ -611,4 +611,4 @@ message 127, 'SessionSearch', :tracker => false, :replayer => false do
uint 'Partition'
end
# FREE 2, 34, 35, 36, 65, 85, 86, 87, 88, 89
# FREE 2, 34, 35, 36, 65, 85, 86, 87, 88

View file

@ -168,3 +168,13 @@ message 111, 'MobileIssueEvent', :replayer => true do
string 'Context'
string 'Payload'
end
message 89, 'MobileGraphQL', :replayer => true do
uint 'Timestamp'
uint 'Length'
string 'OperationKind'
string 'OperationName'
string 'Variables'
string 'Response'
uint 'Duration'
end