add incindent messages

This commit is contained in:
Андрей Бабушкин 2025-05-09 15:46:53 +02:00
parent 2eb4ab4b84
commit 3785a50203
21 changed files with 2717 additions and 2324 deletions

View file

@ -11,4 +11,4 @@ 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
}
}

File diff suppressed because it is too large Load diff

File diff suppressed because it is too large Load diff

View file

@ -716,6 +716,15 @@ class WSChannel(Message):
self.message_type = message_type
class Incident(Message):
__id__ = 85
def __init__(self, label, start_time, end_time):
self.label = label
self.start_time = start_time
self.end_time = end_time
class InputChange(Message):
__id__ = 112

View file

@ -1065,6 +1065,19 @@ cdef class WSChannel(PyMessage):
self.message_type = message_type
cdef class Incident(PyMessage):
cdef public int __id__
cdef public str label
cdef public str start_time
cdef public str end_time
def __init__(self, str label, str start_time, str end_time):
self.__id__ = 85
self.label = label
self.start_time = start_time
self.end_time = end_time
cdef class InputChange(PyMessage):
cdef public int __id__
cdef public unsigned long id

View file

@ -657,6 +657,13 @@ class MessageCodec(Codec):
message_type=self.read_string(reader)
)
if message_id == 85:
return Incident(
label=self.read_string(reader),
start_time=self.read_string(reader),
end_time=self.read_string(reader)
)
if message_id == 112:
return InputChange(
id=self.read_uint(reader),

View file

@ -755,6 +755,13 @@ cdef class MessageCodec:
message_type=self.read_string(reader)
)
if message_id == 85:
return Incident(
label=self.read_string(reader),
start_time=self.read_string(reader),
end_time=self.read_string(reader)
)
if message_id == 112:
return InputChange(
id=self.read_uint(reader),

View file

@ -49,6 +49,8 @@ function EventsBlock(props: IProps) {
const { store, player } = React.useContext(PlayerContext);
const [currentTimeEventIndex, setCurrentTimeEventIndex] = React.useState(0);
console.log('FILTER', uiPlayerStore.showOnlySearchEvents)
const {
time,
endTime,
@ -86,25 +88,28 @@ function EventsBlock(props: IProps) {
}
});
}
const eventsWithMobxNotes = [...notesWithEvents, ...notes]
.sort(sortEvents);
const eventsWithMobxNotes = [...notesWithEvents, ...notes].sort(sortEvents);
const filteredTabEvents = query.length
? tabChangeEvents
.filter((e => (e.activeUrl as string).includes(query)))
: tabChangeEvents;
const list = mergeEventLists(
query.length > 0 ? filteredEvents : eventsWithMobxNotes,
filteredTabEvents
? tabChangeEvents.filter((e) => (e.activeUrl as string).includes(query))
: tabChangeEvents;
return mergeEventLists(
filteredLength > 0 ? filteredEvents : eventsWithMobxNotes,
tabChangeEvents,
)
if (zoomEnabled) {
return list.filter((e) =>
.filter((e) =>
zoomEnabled
? 'time' in e
? e.time >= zoomStartTs && e.time <= zoomEndTs
: false
: true
).filter((e: any) => !e.noteId && e.type !== 'TABCHANGE' && uiPlayerStore.showOnlySearchEvents ? e.isHighlighted : true);
}
? 'time' in e
? e.time >= zoomStartTs && e.time <= zoomEndTs
: false
: true,
)
.filter((e: any) =>
!e.noteId &&
e.type !== 'TABCHANGE' &&
uiPlayerStore.showOnlySearchEvents
? e.isHighlighted
: true,
);
}, [
filteredLength,
query,
@ -113,8 +118,9 @@ function EventsBlock(props: IProps) {
zoomEnabled,
zoomStartTs,
zoomEndTs,
uiPlayerStore.showOnlySearchEvents
uiPlayerStore.showOnlySearchEvents,
]);
const findLastFitting = React.useCallback(
(time: number) => {
if (!usedEvents.length) return 0;
@ -140,7 +146,7 @@ function EventsBlock(props: IProps) {
useEffect(() => {
setCurrentTimeEventIndex(findLastFitting(time));
}, [])
}, []);
const write = ({
target: { value },
@ -196,7 +202,7 @@ function EventsBlock(props: IProps) {
const isTabChange = 'type' in event && event.type === 'TABCHANGE';
const isCurrent = index === currentTimeEventIndex;
const isPrev = index < currentTimeEventIndex;
const isSearched = event.isHighlighted
const isSearched = event.isHighlighted;
return (
<EventGroupWrapper

View file

@ -19,6 +19,19 @@ import { searchStore, searchStoreLive } from './index';
import { checkEventWithFilters } from '@/components/Session_/Player/Controls/checkEventWithFilters';
const range = getDateRangeFromValue(LAST_7_DAYS);
const mockIncidents = [
{
label: 'Inciden 1',
startTime: 1746629916704,
endTime: 1746629916704,
},
{
label: 'Incident 2',
startTime: 1746629916704,
endTime: 1746629916704,
},
]
const defaultDateFilters = {
url: '',
rangeValue: LAST_7_DAYS,
@ -344,8 +357,9 @@ export default class SessionStore {
events: evData.events.map((e) => ({
...e,
isHighlighted: checkEventWithFilters(e, searchStore.instance.filters)
}))
})).concat(mockIncidents)
});
console.log('!!!!', eventsData)
} catch (e) {
console.error('Failed to fetch events', e);
}

View file

@ -1,22 +1,22 @@
// Auto-generated, do not edit
/* eslint-disable */
import PrimitiveReader from './PrimitiveReader'
import { MType } from './raw.gen'
import type { RawMessage } from './raw.gen'
import PrimitiveReader from './PrimitiveReader';
import { MType } from './raw.gen';
import type { RawMessage } from './raw.gen';
export default class RawMessageReader extends PrimitiveReader {
readMessage(): RawMessage | null {
const p = this.p;
const p = this.p
const resetPointer = () => {
this.p = p;
return null;
};
const tp = this.readUint();
if (tp === null) {
return resetPointer();
this.p = p
return null
}
const tp = this.readUint()
if (tp === null) { return resetPointer() }
switch (tp) {
case 0: {
@ -657,6 +657,18 @@ export default class RawMessageReader extends PrimitiveReader {
};
}
case 85: {
const label = this.readString(); if (label === null) { return resetPointer() }
const startTime = this.readString(); if (startTime === null) { return resetPointer() }
const endTime = this.readString(); if (endTime === null) { return resetPointer() }
return {
tp: MType.Incident,
label,
startTime,
endTime,
};
}
case 113: {
const selectionStart = this.readUint(); if (selectionStart === null) { return resetPointer() }
const selectionEnd = this.readUint(); if (selectionEnd === null) { return resetPointer() }

View file

@ -1,16 +1,10 @@
// Auto-generated, do not edit
/* eslint-disable */
import { MType } from './raw.gen';
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 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,
113, 114, 117, 118, 119, 122,
];
const IOS_TYPES = [90,91,92,93,94,95,96,97,98,100,101,102,103,104,105,106,107,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,113,114,117,118,119,122]
export function isDOMType(t: MType) {
return DOM_TYPES.includes(t);
}
return DOM_TYPES.includes(t)
}

View file

@ -1,8 +1,9 @@
// Auto-generated, do not edit
/* eslint-disable */
import type { Timed } from './timed';
import type { Timed } from './timed'
import type { RawMessage } from './raw.gen'
import type {
RawMessage,
RawTimestamp,
RawSetPageLocationDeprecated,
RawSetViewportSize,
@ -56,6 +57,7 @@ import type {
RawZustand,
RawNetworkRequest,
RawWsChannel,
RawIncident,
RawSelectionChange,
RawMouseThrashing,
RawResourceTiming,
@ -76,154 +78,156 @@ import type {
RawMobileNetworkCall,
RawMobileSwipeEvent,
RawMobileIssueEvent,
} from './raw.gen';
} from './raw.gen'
export type Message = RawMessage & Timed;
export type Message = RawMessage & Timed
export type Timestamp = RawTimestamp & Timed;
export type SetPageLocationDeprecated = RawSetPageLocationDeprecated & Timed;
export type Timestamp = RawTimestamp & Timed
export type SetViewportSize = RawSetViewportSize & Timed;
export type SetPageLocationDeprecated = RawSetPageLocationDeprecated & Timed
export type SetViewportScroll = RawSetViewportScroll & Timed;
export type SetViewportSize = RawSetViewportSize & Timed
export type CreateDocument = RawCreateDocument & Timed;
export type SetViewportScroll = RawSetViewportScroll & Timed
export type CreateElementNode = RawCreateElementNode & Timed;
export type CreateDocument = RawCreateDocument & Timed
export type CreateTextNode = RawCreateTextNode & Timed;
export type CreateElementNode = RawCreateElementNode & Timed
export type MoveNode = RawMoveNode & Timed;
export type CreateTextNode = RawCreateTextNode & Timed
export type RemoveNode = RawRemoveNode & Timed;
export type MoveNode = RawMoveNode & Timed
export type SetNodeAttribute = RawSetNodeAttribute & Timed;
export type RemoveNode = RawRemoveNode & Timed
export type RemoveNodeAttribute = RawRemoveNodeAttribute & Timed;
export type SetNodeAttribute = RawSetNodeAttribute & Timed
export type SetNodeData = RawSetNodeData & Timed;
export type RemoveNodeAttribute = RawRemoveNodeAttribute & Timed
export type SetCssData = RawSetCssData & Timed;
export type SetNodeData = RawSetNodeData & Timed
export type SetNodeScroll = RawSetNodeScroll & Timed;
export type SetCssData = RawSetCssData & Timed
export type SetInputValue = RawSetInputValue & Timed;
export type SetNodeScroll = RawSetNodeScroll & Timed
export type SetInputChecked = RawSetInputChecked & Timed;
export type SetInputValue = RawSetInputValue & Timed
export type MouseMove = RawMouseMove & Timed;
export type SetInputChecked = RawSetInputChecked & Timed
export type NetworkRequestDeprecated = RawNetworkRequestDeprecated & Timed;
export type MouseMove = RawMouseMove & Timed
export type ConsoleLog = RawConsoleLog & Timed;
export type NetworkRequestDeprecated = RawNetworkRequestDeprecated & Timed
export type StringDictGlobal = RawStringDictGlobal & Timed;
export type ConsoleLog = RawConsoleLog & Timed
export type SetNodeAttributeDictGlobal = RawSetNodeAttributeDictGlobal & Timed;
export type StringDictGlobal = RawStringDictGlobal & Timed
export type CssInsertRule = RawCssInsertRule & Timed;
export type SetNodeAttributeDictGlobal = RawSetNodeAttributeDictGlobal & Timed
export type Profiler = RawProfiler & Timed
export type ReduxDeprecated = RawReduxDeprecated & Timed;
export type OTable = RawOTable & Timed
export type Vuex = RawVuex & Timed;
export type ReduxDeprecated = RawReduxDeprecated & Timed
export type MobX = RawMobX & Timed;
export type Vuex = RawVuex & Timed
export type NgRx = RawNgRx & Timed;
export type MobX = RawMobX & Timed
export type GraphQlDeprecated = RawGraphQlDeprecated & Timed;
export type NgRx = RawNgRx & Timed
export type PerformanceTrack = RawPerformanceTrack & Timed;
export type GraphQlDeprecated = RawGraphQlDeprecated & Timed
export type StringDictDeprecated = RawStringDictDeprecated & Timed;
export type PerformanceTrack = RawPerformanceTrack & Timed
export type SetNodeAttributeDictDeprecated = RawSetNodeAttributeDictDeprecated &
Timed;
export type StringDictDeprecated = RawStringDictDeprecated & Timed
export type StringDict = RawStringDict & Timed;
export type SetNodeAttributeDictDeprecated = RawSetNodeAttributeDictDeprecated & Timed
export type SetNodeAttributeDict = RawSetNodeAttributeDict & Timed;
export type StringDict = RawStringDict & Timed
export type ResourceTimingDeprecated = RawResourceTimingDeprecated & Timed;
export type SetNodeAttributeDict = RawSetNodeAttributeDict & Timed
export type ConnectionInformation = RawConnectionInformation & Timed;
export type ResourceTimingDeprecated = RawResourceTimingDeprecated & Timed
export type SetPageVisibility = RawSetPageVisibility & Timed;
export type ConnectionInformation = RawConnectionInformation & Timed
export type LoadFontFace = RawLoadFontFace & Timed;
export type SetPageVisibility = RawSetPageVisibility & Timed
export type SetNodeFocus = RawSetNodeFocus & Timed;
export type LoadFontFace = RawLoadFontFace & Timed
export type LongTask = RawLongTask & Timed;
export type SetNodeFocus = RawSetNodeFocus & Timed
export type SetNodeAttributeURLBased = RawSetNodeAttributeURLBased & Timed
export type CssInsertRuleURLBased = RawCssInsertRuleURLBased & Timed;
export type SetCssDataURLBased = RawSetCssDataURLBased & Timed
export type MouseClick = RawMouseClick & Timed
export type CreateIFrameDocument = RawCreateIFrameDocument & Timed;
export type MouseClickDeprecated = RawMouseClickDeprecated & Timed
export type AdoptedSsReplaceURLBased = RawAdoptedSsReplaceURLBased & Timed;
export type CreateIFrameDocument = RawCreateIFrameDocument & Timed
export type AdoptedSsReplace = RawAdoptedSsReplace & Timed;
export type AdoptedSsReplaceURLBased = RawAdoptedSsReplaceURLBased & Timed
export type AdoptedSsInsertRuleURLBased = RawAdoptedSsInsertRuleURLBased &
Timed;
export type AdoptedSsReplace = RawAdoptedSsReplace & Timed
export type AdoptedSsInsertRule = RawAdoptedSsInsertRule & Timed;
export type AdoptedSsInsertRuleURLBased = RawAdoptedSsInsertRuleURLBased & Timed
export type AdoptedSsDeleteRule = RawAdoptedSsDeleteRule & Timed;
export type AdoptedSsInsertRule = RawAdoptedSsInsertRule & Timed
export type AdoptedSsAddOwner = RawAdoptedSsAddOwner & Timed;
export type AdoptedSsDeleteRule = RawAdoptedSsDeleteRule & Timed
export type AdoptedSsRemoveOwner = RawAdoptedSsRemoveOwner & Timed;
export type AdoptedSsAddOwner = RawAdoptedSsAddOwner & Timed
export type Zustand = RawZustand & Timed;
export type AdoptedSsRemoveOwner = RawAdoptedSsRemoveOwner & Timed
export type NetworkRequest = RawNetworkRequest & Timed;
export type Zustand = RawZustand & Timed
export type WsChannel = RawWsChannel & Timed;
export type NetworkRequest = RawNetworkRequest & Timed
export type SelectionChange = RawSelectionChange & Timed;
export type WsChannel = RawWsChannel & Timed
export type MouseThrashing = RawMouseThrashing & Timed;
export type Incident = RawIncident & Timed
export type ResourceTiming = RawResourceTiming & Timed;
export type SelectionChange = RawSelectionChange & Timed
export type TabChange = RawTabChange & Timed;
export type MouseThrashing = RawMouseThrashing & Timed
export type TabData = RawTabData & Timed;
export type ResourceTiming = RawResourceTiming & Timed
export type CanvasNode = RawCanvasNode & Timed;
export type TabChange = RawTabChange & Timed
export type TagTrigger = RawTagTrigger & Timed;
export type TabData = RawTabData & Timed
export type Redux = RawRedux & Timed;
export type CanvasNode = RawCanvasNode & Timed
export type SetPageLocation = RawSetPageLocation & Timed;
export type TagTrigger = RawTagTrigger & Timed
export type GraphQl = RawGraphQl & Timed;
export type Redux = RawRedux & Timed
export type MobileEvent = RawMobileEvent & Timed;
export type SetPageLocation = RawSetPageLocation & Timed
export type MobileScreenChanges = RawMobileScreenChanges & Timed;
export type GraphQl = RawGraphQl & Timed
export type MobileClickEvent = RawMobileClickEvent & Timed;
export type MobileEvent = RawMobileEvent & Timed
export type MobileInputEvent = RawMobileInputEvent & Timed;
export type MobileScreenChanges = RawMobileScreenChanges & Timed
export type MobilePerformanceEvent = RawMobilePerformanceEvent & Timed;
export type MobileClickEvent = RawMobileClickEvent & Timed
export type MobileLog = RawMobileLog & Timed;
export type MobileInputEvent = RawMobileInputEvent & Timed
export type MobileInternalError = RawMobileInternalError & Timed;
export type MobilePerformanceEvent = RawMobilePerformanceEvent & Timed
export type MobileNetworkCall = RawMobileNetworkCall & Timed;
export type MobileLog = RawMobileLog & Timed
export type MobileSwipeEvent = RawMobileSwipeEvent & Timed;
export type MobileInternalError = RawMobileInternalError & Timed
export type MobileNetworkCall = RawMobileNetworkCall & Timed
export type MobileSwipeEvent = RawMobileSwipeEvent & Timed
export type MobileIssueEvent = RawMobileIssueEvent & Timed
export type MobileIssueEvent = RawMobileIssueEvent & Timed;

View file

@ -1,4 +1,5 @@
// Auto-generated, do not edit
/* eslint-disable */
export const enum MType {
Timestamp = 0,
@ -54,6 +55,7 @@ export const enum MType {
Zustand = 79,
NetworkRequest = 83,
WsChannel = 84,
Incident = 85,
SelectionChange = 113,
MouseThrashing = 114,
ResourceTiming = 116,
@ -76,539 +78,548 @@ export const enum MType {
MobileIssueEvent = 111,
}
export interface RawTimestamp {
tp: MType.Timestamp;
timestamp: number;
tp: MType.Timestamp,
timestamp: number,
}
export interface RawSetPageLocationDeprecated {
tp: MType.SetPageLocationDeprecated;
url: string;
referrer: string;
navigationStart: number;
tp: MType.SetPageLocationDeprecated,
url: string,
referrer: string,
navigationStart: number,
}
export interface RawSetViewportSize {
tp: MType.SetViewportSize;
width: number;
height: number;
tp: MType.SetViewportSize,
width: number,
height: number,
}
export interface RawSetViewportScroll {
tp: MType.SetViewportScroll;
x: number;
y: number;
tp: MType.SetViewportScroll,
x: number,
y: number,
}
export interface RawCreateDocument {
tp: MType.CreateDocument;
tp: MType.CreateDocument,
}
export interface RawCreateElementNode {
tp: MType.CreateElementNode;
id: number;
parentID: number;
index: number;
tag: string;
svg: boolean;
tp: MType.CreateElementNode,
id: number,
parentID: number,
index: number,
tag: string,
svg: boolean,
}
export interface RawCreateTextNode {
tp: MType.CreateTextNode;
id: number;
parentID: number;
index: number;
tp: MType.CreateTextNode,
id: number,
parentID: number,
index: number,
}
export interface RawMoveNode {
tp: MType.MoveNode;
id: number;
parentID: number;
index: number;
tp: MType.MoveNode,
id: number,
parentID: number,
index: number,
}
export interface RawRemoveNode {
tp: MType.RemoveNode;
id: number;
tp: MType.RemoveNode,
id: number,
}
export interface RawSetNodeAttribute {
tp: MType.SetNodeAttribute;
id: number;
name: string;
value: string;
tp: MType.SetNodeAttribute,
id: number,
name: string,
value: string,
}
export interface RawRemoveNodeAttribute {
tp: MType.RemoveNodeAttribute;
id: number;
name: string;
tp: MType.RemoveNodeAttribute,
id: number,
name: string,
}
export interface RawSetNodeData {
tp: MType.SetNodeData;
id: number;
data: string;
tp: MType.SetNodeData,
id: number,
data: string,
}
export interface RawSetCssData {
tp: MType.SetCssData;
id: number;
data: string;
tp: MType.SetCssData,
id: number,
data: string,
}
export interface RawSetNodeScroll {
tp: MType.SetNodeScroll;
id: number;
x: number;
y: number;
tp: MType.SetNodeScroll,
id: number,
x: number,
y: number,
}
export interface RawSetInputValue {
tp: MType.SetInputValue;
id: number;
value: string;
mask: number;
tp: MType.SetInputValue,
id: number,
value: string,
mask: number,
}
export interface RawSetInputChecked {
tp: MType.SetInputChecked;
id: number;
checked: boolean;
tp: MType.SetInputChecked,
id: number,
checked: boolean,
}
export interface RawMouseMove {
tp: MType.MouseMove;
x: number;
y: number;
tp: MType.MouseMove,
x: number,
y: number,
}
export interface RawNetworkRequestDeprecated {
tp: MType.NetworkRequestDeprecated;
type: string;
method: string;
url: string;
request: string;
response: string;
status: number;
timestamp: number;
duration: number;
tp: MType.NetworkRequestDeprecated,
type: string,
method: string,
url: string,
request: string,
response: string,
status: number,
timestamp: number,
duration: number,
}
export interface RawConsoleLog {
tp: MType.ConsoleLog;
level: string;
value: string;
tp: MType.ConsoleLog,
level: string,
value: string,
}
export interface RawStringDictGlobal {
tp: MType.StringDictGlobal;
key: number;
value: string;
tp: MType.StringDictGlobal,
key: number,
value: string,
}
export interface RawSetNodeAttributeDictGlobal {
tp: MType.SetNodeAttributeDictGlobal;
id: number;
name: number;
value: number;
tp: MType.SetNodeAttributeDictGlobal,
id: number,
name: number,
value: number,
}
export interface RawProfiler {
tp: MType.Profiler;
name: string;
duration: number;
args: string;
result: string;
tp: MType.Profiler,
name: string,
duration: number,
args: string,
result: string,
}
export interface RawOTable {
tp: MType.OTable;
key: string;
value: string;
tp: MType.OTable,
key: string,
value: string,
}
export interface RawReduxDeprecated {
tp: MType.ReduxDeprecated;
action: string;
state: string;
duration: number;
tp: MType.ReduxDeprecated,
action: string,
state: string,
duration: number,
}
export interface RawVuex {
tp: MType.Vuex;
mutation: string;
state: string;
tp: MType.Vuex,
mutation: string,
state: string,
}
export interface RawMobX {
tp: MType.MobX;
type: string;
payload: string;
tp: MType.MobX,
type: string,
payload: string,
}
export interface RawNgRx {
tp: MType.NgRx;
action: string;
state: string;
duration: number;
tp: MType.NgRx,
action: string,
state: string,
duration: number,
}
export interface RawGraphQlDeprecated {
tp: MType.GraphQlDeprecated;
operationKind: string;
operationName: string;
variables: string;
response: string;
duration: number;
tp: MType.GraphQlDeprecated,
operationKind: string,
operationName: string,
variables: string,
response: string,
duration: number,
}
export interface RawPerformanceTrack {
tp: MType.PerformanceTrack;
frames: number;
ticks: number;
totalJSHeapSize: number;
usedJSHeapSize: number;
tp: MType.PerformanceTrack,
frames: number,
ticks: number,
totalJSHeapSize: number,
usedJSHeapSize: number,
}
export interface RawStringDictDeprecated {
tp: MType.StringDictDeprecated;
key: number;
value: string;
tp: MType.StringDictDeprecated,
key: number,
value: string,
}
export interface RawSetNodeAttributeDictDeprecated {
tp: MType.SetNodeAttributeDictDeprecated;
id: number;
nameKey: number;
valueKey: number;
tp: MType.SetNodeAttributeDictDeprecated,
id: number,
nameKey: number,
valueKey: number,
}
export interface RawStringDict {
tp: MType.StringDict;
key: string;
value: string;
tp: MType.StringDict,
key: string,
value: string,
}
export interface RawSetNodeAttributeDict {
tp: MType.SetNodeAttributeDict;
id: number;
name: string;
value: string;
tp: MType.SetNodeAttributeDict,
id: number,
name: string,
value: string,
}
export interface RawResourceTimingDeprecated {
tp: MType.ResourceTimingDeprecated;
timestamp: number;
duration: number;
ttfb: number;
headerSize: number;
encodedBodySize: number;
decodedBodySize: number;
url: string;
initiator: string;
tp: MType.ResourceTimingDeprecated,
timestamp: number,
duration: number,
ttfb: number,
headerSize: number,
encodedBodySize: number,
decodedBodySize: number,
url: string,
initiator: string,
}
export interface RawConnectionInformation {
tp: MType.ConnectionInformation;
downlink: number;
type: string;
tp: MType.ConnectionInformation,
downlink: number,
type: string,
}
export interface RawSetPageVisibility {
tp: MType.SetPageVisibility;
hidden: boolean;
tp: MType.SetPageVisibility,
hidden: boolean,
}
export interface RawLoadFontFace {
tp: MType.LoadFontFace;
parentID: number;
family: string;
source: string;
descriptors: string;
tp: MType.LoadFontFace,
parentID: number,
family: string,
source: string,
descriptors: string,
}
export interface RawSetNodeFocus {
tp: MType.SetNodeFocus;
id: number;
tp: MType.SetNodeFocus,
id: number,
}
export interface RawSetNodeAttributeURLBased {
tp: MType.SetNodeAttributeURLBased;
id: number;
name: string;
value: string;
baseURL: string;
tp: MType.SetNodeAttributeURLBased,
id: number,
name: string,
value: string,
baseURL: string,
}
export interface RawSetCssDataURLBased {
tp: MType.SetCssDataURLBased;
id: number;
data: string;
baseURL: string;
tp: MType.SetCssDataURLBased,
id: number,
data: string,
baseURL: string,
}
export interface RawMouseClick {
tp: MType.MouseClick;
id: number;
hesitationTime: number;
label: string;
selector: string;
normalizedX: number;
normalizedY: number;
tp: MType.MouseClick,
id: number,
hesitationTime: number,
label: string,
selector: string,
normalizedX: number,
normalizedY: number,
}
export interface RawMouseClickDeprecated {
tp: MType.MouseClickDeprecated;
id: number;
hesitationTime: number;
label: string;
selector: string;
tp: MType.MouseClickDeprecated,
id: number,
hesitationTime: number,
label: string,
selector: string,
}
export interface RawCreateIFrameDocument {
tp: MType.CreateIFrameDocument;
frameID: number;
id: number;
tp: MType.CreateIFrameDocument,
frameID: number,
id: number,
}
export interface RawAdoptedSsReplaceURLBased {
tp: MType.AdoptedSsReplaceURLBased;
sheetID: number;
text: string;
baseURL: string;
tp: MType.AdoptedSsReplaceURLBased,
sheetID: number,
text: string,
baseURL: string,
}
export interface RawAdoptedSsReplace {
tp: MType.AdoptedSsReplace;
sheetID: number;
text: string;
tp: MType.AdoptedSsReplace,
sheetID: number,
text: string,
}
export interface RawAdoptedSsInsertRuleURLBased {
tp: MType.AdoptedSsInsertRuleURLBased;
sheetID: number;
rule: string;
index: number;
baseURL: string;
tp: MType.AdoptedSsInsertRuleURLBased,
sheetID: number,
rule: string,
index: number,
baseURL: string,
}
export interface RawAdoptedSsInsertRule {
tp: MType.AdoptedSsInsertRule;
sheetID: number;
rule: string;
index: number;
tp: MType.AdoptedSsInsertRule,
sheetID: number,
rule: string,
index: number,
}
export interface RawAdoptedSsDeleteRule {
tp: MType.AdoptedSsDeleteRule;
sheetID: number;
index: number;
tp: MType.AdoptedSsDeleteRule,
sheetID: number,
index: number,
}
export interface RawAdoptedSsAddOwner {
tp: MType.AdoptedSsAddOwner;
sheetID: number;
id: number;
tp: MType.AdoptedSsAddOwner,
sheetID: number,
id: number,
}
export interface RawAdoptedSsRemoveOwner {
tp: MType.AdoptedSsRemoveOwner;
sheetID: number;
id: number;
tp: MType.AdoptedSsRemoveOwner,
sheetID: number,
id: number,
}
export interface RawZustand {
tp: MType.Zustand;
mutation: string;
state: string;
tp: MType.Zustand,
mutation: string,
state: string,
}
export interface RawNetworkRequest {
tp: MType.NetworkRequest;
type: string;
method: string;
url: string;
request: string;
response: string;
status: number;
timestamp: number;
duration: number;
transferredBodySize: number;
tp: MType.NetworkRequest,
type: string,
method: string,
url: string,
request: string,
response: string,
status: number,
timestamp: number,
duration: number,
transferredBodySize: number,
}
export interface RawWsChannel {
tp: MType.WsChannel;
chType: string;
channelName: string;
data: string;
timestamp: number;
dir: string;
messageType: string;
tp: MType.WsChannel,
chType: string,
channelName: string,
data: string,
timestamp: number,
dir: string,
messageType: string,
}
export interface RawIncident {
tp: MType.Incident,
label: string,
startTime: string,
endTime: string,
}
export interface RawSelectionChange {
tp: MType.SelectionChange;
selectionStart: number;
selectionEnd: number;
selection: string;
tp: MType.SelectionChange,
selectionStart: number,
selectionEnd: number,
selection: string,
}
export interface RawMouseThrashing {
tp: MType.MouseThrashing;
timestamp: number;
tp: MType.MouseThrashing,
timestamp: number,
}
export interface RawResourceTiming {
tp: MType.ResourceTiming;
timestamp: number;
duration: number;
ttfb: number;
headerSize: number;
encodedBodySize: number;
decodedBodySize: number;
url: string;
initiator: string;
transferredSize: number;
cached: boolean;
tp: MType.ResourceTiming,
timestamp: number,
duration: number,
ttfb: number,
headerSize: number,
encodedBodySize: number,
decodedBodySize: number,
url: string,
initiator: string,
transferredSize: number,
cached: boolean,
}
export interface RawTabChange {
tp: MType.TabChange;
tabId: string;
tp: MType.TabChange,
tabId: string,
}
export interface RawTabData {
tp: MType.TabData;
tabId: string;
tp: MType.TabData,
tabId: string,
}
export interface RawCanvasNode {
tp: MType.CanvasNode;
nodeId: string;
timestamp: number;
tp: MType.CanvasNode,
nodeId: string,
timestamp: number,
}
export interface RawTagTrigger {
tp: MType.TagTrigger;
tagId: number;
tp: MType.TagTrigger,
tagId: number,
}
export interface RawRedux {
tp: MType.Redux;
action: string;
state: string;
duration: number;
actionTime: number;
tp: MType.Redux,
action: string,
state: string,
duration: number,
actionTime: number,
}
export interface RawSetPageLocation {
tp: MType.SetPageLocation;
url: string;
referrer: string;
navigationStart: number;
documentTitle: string;
tp: MType.SetPageLocation,
url: string,
referrer: string,
navigationStart: number,
documentTitle: string,
}
export interface RawGraphQl {
tp: MType.GraphQl;
operationKind: string;
operationName: string;
variables: string;
response: string;
duration: number;
tp: MType.GraphQl,
operationKind: string,
operationName: string,
variables: string,
response: string,
duration: number,
}
export interface RawMobileEvent {
tp: MType.MobileEvent;
timestamp: number;
length: number;
name: string;
payload: string;
tp: MType.MobileEvent,
timestamp: number,
length: number,
name: string,
payload: string,
}
export interface RawMobileScreenChanges {
tp: MType.MobileScreenChanges;
timestamp: number;
length: number;
x: number;
y: number;
width: number;
height: number;
tp: MType.MobileScreenChanges,
timestamp: number,
length: number,
x: number,
y: number,
width: number,
height: number,
}
export interface RawMobileClickEvent {
tp: MType.MobileClickEvent;
timestamp: number;
length: number;
label: string;
x: number;
y: number;
tp: MType.MobileClickEvent,
timestamp: number,
length: number,
label: string,
x: number,
y: number,
}
export interface RawMobileInputEvent {
tp: MType.MobileInputEvent;
timestamp: number;
length: number;
value: string;
valueMasked: boolean;
label: string;
tp: MType.MobileInputEvent,
timestamp: number,
length: number,
value: string,
valueMasked: boolean,
label: string,
}
export interface RawMobilePerformanceEvent {
tp: MType.MobilePerformanceEvent;
timestamp: number;
length: number;
name: string;
value: number;
tp: MType.MobilePerformanceEvent,
timestamp: number,
length: number,
name: string,
value: number,
}
export interface RawMobileLog {
tp: MType.MobileLog;
timestamp: number;
length: number;
severity: string;
content: string;
tp: MType.MobileLog,
timestamp: number,
length: number,
severity: string,
content: string,
}
export interface RawMobileInternalError {
tp: MType.MobileInternalError;
timestamp: number;
length: number;
content: string;
tp: MType.MobileInternalError,
timestamp: number,
length: number,
content: string,
}
export interface RawMobileNetworkCall {
tp: MType.MobileNetworkCall;
timestamp: number;
length: number;
type: string;
method: string;
url: string;
request: string;
response: string;
status: number;
duration: number;
tp: MType.MobileNetworkCall,
timestamp: number,
length: number,
type: string,
method: string,
url: string,
request: string,
response: string,
status: number,
duration: number,
}
export interface RawMobileSwipeEvent {
tp: MType.MobileSwipeEvent;
timestamp: number;
length: number;
label: string;
x: number;
y: number;
direction: string;
tp: MType.MobileSwipeEvent,
timestamp: number,
length: number,
label: string,
x: number,
y: number,
direction: string,
}
export interface RawMobileIssueEvent {
tp: MType.MobileIssueEvent;
timestamp: number;
type: string;
contextString: string;
context: string;
payload: string;
tp: MType.MobileIssueEvent,
timestamp: number,
type: string,
contextString: string,
context: string,
payload: string,
}
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 | 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 | RawIncident | RawSelectionChange | RawMouseThrashing | RawResourceTiming | RawTabChange | RawTabData | RawCanvasNode | RawTagTrigger | RawRedux | RawSetPageLocation | RawGraphQl | RawMobileEvent | RawMobileScreenChanges | RawMobileClickEvent | RawMobileInputEvent | RawMobilePerformanceEvent | RawMobileLog | RawMobileInternalError | RawMobileNetworkCall | RawMobileSwipeEvent | RawMobileIssueEvent;

View file

@ -1,6 +1,6 @@
// Auto-generated, do not edit
import { MType } from './raw.gen';
import { MType } from './raw.gen'
export const TP_MAP = {
0: MType.Timestamp,
@ -56,6 +56,7 @@ export const TP_MAP = {
79: MType.Zustand,
83: MType.NetworkRequest,
84: MType.WsChannel,
85: MType.Incident,
113: MType.SelectionChange,
114: MType.MouseThrashing,
116: MType.ResourceTiming,
@ -76,4 +77,4 @@ export const TP_MAP = {
105: MType.MobileNetworkCall,
106: MType.MobileSwipeEvent,
111: MType.MobileIssueEvent,
} as const;
} as const

File diff suppressed because it is too large Load diff

View file

@ -10,6 +10,7 @@ const IOS_VIEW = 'VIEW';
const UXT_EVENT = 'UXT_EVENT';
const TOUCH = 'TAP';
const SWIPE = 'SWIPE';
const INCIDENT = 'INCIDENT';
export const TYPES = {
CONSOLE,
@ -24,6 +25,7 @@ export const TYPES = {
SWIPE,
TAPRAGE,
UXT_EVENT,
INCIDENT,
};
export type EventType =
@ -35,7 +37,8 @@ export type EventType =
| typeof CLICKRAGE
| typeof IOS_VIEW
| typeof TOUCH
| typeof SWIPE;
| typeof SWIPE
| typeof INCIDENT
interface IEvent {
time: number;
@ -99,6 +102,12 @@ export interface LocationEvent extends IEvent {
webVitals: string | null;
}
export interface IncidentEvent extends IEvent {
label: string;
startTime: number;
endTime: number;
}
export type EventData =
| ConsoleEvent
| ClickEvent
@ -276,6 +285,22 @@ export class Location extends Event {
}
}
export class Incident extends Event {
readonly name = 'Incident';
readonly type = CUSTOM;
constructor(evt: IncidentEvent) {
super(evt);
Object.assign(this, {
...evt,
label: evt.label || 'User signaled an incident',
startTime: evt.startTime,
endTime: evt.startTime || evt.endTime,
});
}
}
export type InjectedEvent =
| Console
| Click
@ -283,9 +308,11 @@ export type InjectedEvent =
| Location
| Touch
| Swipe
| UxtEvent;
| UxtEvent
| Incident;
export default function (event: EventData) {
console.log('DEETECT EVENT', event);
if ('allow_typing' in event) {
return new UxtEvent(event);
}
@ -307,6 +334,8 @@ export default function (event: EventData) {
return new Click(event as ClickEvent, true);
case SWIPE:
return new Swipe(event as SwipeEvent);
case INCIDENT:
return new Incident(event as IncidentEvent);
default:
return console.error(`Unknown event type: ${event.type}`);
}

View file

@ -450,6 +450,12 @@ message 84, 'WSChannel', :replayer => :devtools do
string 'MessageType'
end
message 85, 'Incident', :replayer => :devtools do
string 'Label'
string 'StartTime'
string 'EndTime'
end
# 90-111 reserved iOS
message 112, 'InputChange', :replayer => false do
@ -551,4 +557,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, 86, 87, 88, 89

View file

@ -65,6 +65,7 @@ export declare const enum Type {
PartitionedMessage = 82,
NetworkRequest = 83,
WSChannel = 84,
Incident = 85,
InputChange = 112,
SelectionChange = 113,
MouseThrashing = 114,
@ -522,6 +523,13 @@ export type WSChannel = [
/*messageType:*/ string,
]
export type Incident = [
/*type:*/ Type.Incident,
/*label:*/ string,
/*startTime:*/ string,
/*endTime:*/ string,
]
export type InputChange = [
/*type:*/ Type.InputChange,
/*id:*/ number,
@ -616,5 +624,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 | 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 | Incident | InputChange | SelectionChange | MouseThrashing | UnbindNodes | ResourceTiming | TabChange | TabData | CanvasNode | TagTrigger | Redux | SetPageLocation | GraphQL | WebVitals
export default Message

View file

@ -824,6 +824,19 @@ export function WSChannel(
]
}
export function Incident(
label: string,
startTime: string,
endTime: string,
): Messages.Incident {
return [
Messages.Type.Incident,
label,
startTime,
endTime,
]
}
export function InputChange(
id: number,
value: string,

View file

@ -2,7 +2,7 @@ import App from './app/index.js'
export { default as App } from './app/index.js'
import { UserAnonymousID, CustomEvent, CustomIssue } from './app/messages.gen.js'
import { UserAnonymousID, CustomEvent, CustomIssue, Incident } from './app/messages.gen.js'
import * as _Messages from './app/messages.gen.js'
export const Messages = _Messages
@ -528,4 +528,15 @@ export default class API {
}
}
}
incident = (options: {
label?: string;
startTime: number;
endTime?: number;
}) => {
if (this.app === null) {
return
}
this.app.send(Incident(options.label ?? '', options.startTime, options.endTime ?? options.startTime))
}
}

View file

@ -262,6 +262,10 @@ export default class MessageEncoder extends PrimitiveEncoder {
return this.string(msg[1]) && this.string(msg[2]) && this.string(msg[3]) && this.uint(msg[4]) && this.string(msg[5]) && this.string(msg[6])
break
case Messages.Type.Incident:
return this.string(msg[1]) && this.string(msg[2]) && this.string(msg[3])
break
case Messages.Type.InputChange:
return this.uint(msg[1]) && this.string(msg[2]) && this.boolean(msg[3]) && this.string(msg[4]) && this.int(msg[5]) && this.int(msg[6])
break