Skip to content

Commit

Permalink
fix
Browse files Browse the repository at this point in the history
  • Loading branch information
pauldambra committed Jan 2, 2024
1 parent 72bd0b7 commit 23c7477
Show file tree
Hide file tree
Showing 2 changed files with 83 additions and 4 deletions.
10 changes: 6 additions & 4 deletions ee/frontend/mobile-replay/mobile.types.ts
Original file line number Diff line number Diff line change
Expand Up @@ -278,10 +278,12 @@ export type fullSnapshotEvent = {
}
}

export type incrementalSnapshotEvent = {
type: EventType.IncrementalSnapshot
data: any // TODO: this will change as we implement incremental snapshots
}
export type incrementalSnapshotEvent =
| {
type: EventType.IncrementalSnapshot
data: any // keeps a loose incremental type so that we can accept any rrweb incremental snapshot event type
}
| MobileIncrementalSnapshotEvent

export type MobileNodeMutation = {
parentId: number
Expand Down
77 changes: 77 additions & 0 deletions ee/frontend/mobile-replay/schema/mobile/rr-mobile-schema.json
Original file line number Diff line number Diff line change
Expand Up @@ -120,6 +120,33 @@
"required": ["data", "timestamp", "type"],
"type": "object"
},
{
"additionalProperties": false,
"properties": {
"data": {
"anyOf": [
{
"$ref": "#/definitions/MobileAddedNodeMutationData"
},
{
"$ref": "#/definitions/MobileUpdatedNodeMutationData"
}
],
"description": "This sits alongside the RRWeb incremental snapshot event type, mobile replay can send any of the RRWeb incremental snapshot event types, which will be passed unchanged to the player - for example to send touch events. removed node mutations are passed unchanged to the player."
},
"delay": {
"type": "number"
},
"timestamp": {
"type": "number"
},
"type": {
"$ref": "#/definitions/EventType.IncrementalSnapshot"
}
},
"required": ["data", "timestamp", "type"],
"type": "object"
},
{
"additionalProperties": false,
"properties": {
Expand Down Expand Up @@ -207,6 +234,39 @@
"const": 4,
"type": "number"
},
"IncrementalSource.Mutation": {
"const": 0,
"type": "number"
},
"MobileAddedNodeMutationData": {
"additionalProperties": false,
"properties": {
"adds": {
"items": {
"$ref": "#/definitions/MobileNodeMutation"
},
"type": "array"
},
"source": {
"$ref": "#/definitions/IncrementalSource.Mutation"
}
},
"required": ["source", "adds"],
"type": "object"
},
"MobileNodeMutation": {
"additionalProperties": false,
"properties": {
"parentId": {
"type": "number"
},
"wireframe": {
"$ref": "#/definitions/wireframe"
}
},
"required": ["parentId", "wireframe"],
"type": "object"
},
"MobileNodeType": {
"enum": ["text", "image", "rectangle", "placeholder", "web_view", "input", "div", "radio_group"],
"type": "string"
Expand Down Expand Up @@ -255,6 +315,23 @@
},
"type": "object"
},
"MobileUpdatedNodeMutationData": {
"additionalProperties": false,
"properties": {
"source": {
"$ref": "#/definitions/IncrementalSource.Mutation"
},
"updates": {
"description": "An update is implemented as a remove and then an add, so the updates array contains the ID of the removed node and the wireframe for the added node",
"items": {
"$ref": "#/definitions/MobileNodeMutation"
},
"type": "array"
}
},
"required": ["source", "updates"],
"type": "object"
},
"wireframe": {
"anyOf": [
{
Expand Down

0 comments on commit 23c7477

Please sign in to comment.