-
Notifications
You must be signed in to change notification settings - Fork 1.4k
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
feat: canvas replay #19583
feat: canvas replay #19583
Conversation
import { CanvasArg, type canvasMutationData, type canvasMutationParam, eventWithTime } from '@rrweb/types' | ||
import { EventType, IncrementalSource, Replayer } from 'rrweb' | ||
// TODO: figure out how to import this method | ||
import canvasMutation from 'rrweb/es/rrweb/packages/rrweb/src/replay/canvas' |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Hoping to get this in via rrweb-io/rrweb#1383
@@ -89,22 +87,6 @@ | |||
LIMIT 21 /*controller='team-detail',route='api/projects/%28%3FP%3Cid%3E%5B%5E/.%5D%2B%29/%3F%24'*/ | |||
' | |||
--- | |||
# name: TestDecide.test_decide_doesnt_error_out_when_database_is_down.10 |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Nice cleaning up
if not all(key in ["record_canvas"] for key in value.keys()): | ||
raise exceptions.ValidationError("Must provide a dictionary with only 'record_canvas' key.") |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Maybe it should not be a dictionary then?
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Ah, I'd forgotten my pre-xmas good citizen push that we should move session replay config into one place so we can stop adding more nad more columns to the team model
Maybe we should get this in and then I use it for the config in #19887
This PR hasn't seen activity in a week! Should it be merged, closed, or further worked on? If you want to keep it open, post a comment or remove the |
21514d4
to
8fde514
Compare
Size Change: +46 B (0%) Total Size: 2 MB ℹ️ View Unchanged
|
5726a7d
to
03f508e
Compare
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
👍 I can validate that it doesn't break existing recordings :)
How do I test canvas recordings? (maybe being silly)
@@ -526,6 +527,10 @@ export const sessionRecordingPlayerLogic = kea<sessionRecordingPlayerLogicType>( | |||
plugins.push(CorsPlugin) | |||
} | |||
|
|||
if (values.featureFlags[FEATURE_FLAGS.SESSION_REPLAY_CANVAS]) { |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
is it possible to get in a state where I'm collecting canvas recordings but this flag is off?
not blocking here but we should have a good story for "this replay has a canvas in it"
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
also makes me think it'd be good to have a PostHog insight showing web vs android vs canvas vs etc playback so we can measure feature usage
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Yes, possibly could be. We should also consider in future that recordings might be captured with canvas and then the config option is turned off. Should we continue to playback recordings with the canvas or not in that situation 🤔
Good news is that it's pretty easy to know if a recording contains a canvas in the rrweb plugin during playback
if not all(key in ["record_canvas"] for key in value.keys()): | ||
raise exceptions.ValidationError("Must provide a dictionary with only 'record_canvas' key.") |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Ah, I'd forgotten my pre-xmas good citizen push that we should move session replay config into one place so we can stop adding more nad more columns to the team model
Maybe we should get this in and then I use it for the config in #19887
posthog/models/team/team.py
Outdated
@@ -184,6 +184,7 @@ class Team(UUIDClassicModel): | |||
) | |||
session_recording_linked_flag: models.JSONField = models.JSONField(null=True, blank=True) | |||
session_recording_network_payload_capture_config: models.JSONField = models.JSONField(null=True, blank=True) | |||
session_recording_config: models.JSONField = models.JSONField(null=True, blank=True) |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
nitpicking... should it be session_replay_config
? (am open to be convinced not :))
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Nope, think you're right
@pauldambra it's a little tricky / awkward. I added a I also have an exported recording that I can send you 😄 |
9c094ba
to
5855334
Compare
87acdc6
to
d6a7660
Compare
839f073
to
e0993a9
Compare
Problem
Related to PostHog/posthog-js#946 and #14555
Provide config via decide & playback canvas mutation events
Changes
session_recording_config
to store all future settings related to replay in a single bagHow did you test this code?
Jan-19-2024.17-39-57.mp4