Repository navigation
fix: drop replay debug keys while session replay is off #992
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
Open
ioannisj
wants to merge
6
commits into
main
Choose a base branch
from
fix/drop-replay-debug-keys-when-off
base: main
Could not load branches
Branch not found: {{ refName }}
Loading
Could not load tags
Nothing to show
Loading
Are you sure you want to change the base?
Some commits from the old base branch may be removed from the timeline,
and old review comments may become outdated.
Open
Changes from all commits
Commits
Show all changes
6 commits
Select commit
Hold shift + click to select a range
27b35e1
fix: drop replay debug keys while session replay is off
ioannisj 82dd131
refactor: fold the replay-off gate into the debug property flow
ioannisj 66c9562
test: cover remote replay off then on restoring the replay debug keys
ioannisj fdc49f5
fix: keep replay debug keys while the recorder is running
ioannisj e8809d3
fix: keep replay debug keys until a remotely disabled recorder stops
ioannisj 531a7c0
Merge remote-tracking branch 'origin/main' into pr992-merge
turnipdabeets File filter
Filter by extension
Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
There are no files selected for viewing
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
| Original file line number | Diff line number | Diff line change |
|---|---|---|
| @@ -0,0 +1,6 @@ | ||
| --- | ||
| "posthog": patch | ||
| "posthog-android": patch | ||
| --- | ||
|
|
||
| Stop sending `$sdk_debug_replay_*` and `$sdk_debug_session_start` on events while session replay is intentionally off (disabled in config, stopped by the app, or turned off remotely). `$recording_status` is still sent as `disabled`. Sampled-out and trigger-pending sessions are unchanged. |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Oops, something went wrong.
Oops, something went wrong.
Add this suggestion to a batch that can be applied as a single commit.
This suggestion is invalid because no changes were made to the code.
Suggestions cannot be applied while the pull request is closed.
Suggestions cannot be applied while viewing a subset of changes.
Only one suggestion per line can be applied in a batch.
Add this suggestion to a batch that can be applied as a single commit.
Applying suggestions on deleted lines is not supported.
You must change the existing code in this line in order to create a valid suggestion.
Outdated suggestions cannot be applied.
This suggestion has been applied or marked resolved.
Suggestions cannot be applied from pending reviews.
Suggestions cannot be applied on multi-line comments.
Suggestions cannot be applied while the pull request is queued to merge.
Suggestion cannot be applied right now. Please check back later.
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.
[P1/design] Agree on the reduced wire shape before releasing it
IMPORTANT · REQUIRED acceptance decision · intentional wire change, not a second recorder defect
Initialize the client without a replay integration and capture the first eligible event, such as
sdk.screen("Home"). On base the event carries$sdk_debug_session_start; on head it does not. The current replay-debug spec expects the fallback session-start key when available and capture mode where provided. It separately requires config-derived diagnostics after stop or uninstall. The equivalent base/head probe verified the session-start removal, and the batch fixture records the intended wire change. Running more tests cannot resolve which contract should govern the release.sdk-specs#232 proposes the reduced shape but is still open. It also says a successful mobile response missing
sessionRecordingis not remote-off. Android’s decoder already treated omission asfalsefor recording; this PR newly makes omission suppress event diagnostics too. The executed probe verified suppression for both omitted and explicit false, while an enabled-object response retained diagnostics on both revisions. The current backend producer always writes the field, so this is a compatibility decision for omitted-field responses, not evidence of a current Cloud failure. The proposed spec also calls for gating the raw wrapper map; the React Native Android bridge readsPostHogReplayIntegration.debugProperties()directly and is not gated by this change.Consider landing the spec change first or explicitly sequencing the two releases. Record whether omission should preserve diagnostics, including after a previously known remote-off result, and whether the native bridge is in scope or owned by a separate change. If omission should preserve diagnostics, distinguish field presence for this diagnostic gate without changing existing recording eligibility. Once agreed, pin the distinction with separate omitted, explicit-false, quota, and valid-object response assertions; verify the native bridge separately if the agreed contract covers 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.
Agreed on the order, I'll hold this until sdk-specs#232 lands so the release doesn't go out ahead of the spec.
On the two open bits:
sessionRecordingkey: I'll amend chore: delete queue files if serialization fails #232 to record that Android treats it as off, which is what the recorder already does (more on the missing-key thread).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.
Correction on the RN bridge bit: #232 keeps the wrapper-map requirement and marks Android partial, rather than amending the scenario. A follow-up adds a gated internal accessor and moves the RN bridge to it.
The status already follows the running recorder here (
!handler.isActive()inPostHog.kt), and #232 now makes that the rule for every SDK. The missing-key allowance is in the spec text too. #232 is approved at 9b0ba3a, so this one goes in right after it merges.