Skip to content

feat: add manual session replay startup - #6

Merged
dustinbyrne merged 1 commit into
feat/rust-v1-embeddingfrom
feat/manual-session-replay
Oct 29, 2026
Merged

dustinbyrne merged 1 commit into
feat/rust-v1-embeddingfrom
feat/manual-session-replay

Conversation

@dustinbyrne

Copy link
Copy Markdown
Collaborator

Motivation and context

Games need to start session replay after a gameplay milestone rather than immediately after SDK setup.

  • Add UPostHogSubsystem::StartSessionReplay() for C++ and Blueprints.
  • Add Replay.bAutoStart (default true). Set it to false with Replay.bEnabled = true to defer recording until an explicit call after setup.
  • Repeated starts reuse the recorder. Existing consent, remote configuration, foreground/session gates and shutdown ownership remain unchanged.

Targets feat/rust-v1-embedding, which contains the experimental replay implementation. This is an additive API with unchanged defaults; no migration or native ABI change is required. Remote-config endpoint support remains separate work.

How did you test it?

On macOS arm64 with Unreal Engine 5.8:

  • Built the native bridge with scripts/build-native.sh and the base branch's local Rust embedding dependency, then built the Unreal consumer with scripts/build-example.sh.
  • Ran Tests/native_integration.py against the maintained SDK mock server: 12 native integration tests passed.
  • Ran its Unreal editor integration test: all 9 PostHog.* automation tests passed under -nullrhi.
  • Ran PostHog.ReplayStartup again with rendering enabled: verified the reflected Blueprint entry point, no startup in manual mode, idempotent successful start, automatic startup, and shutdown. Two real recorder instances started and stopped; remote capture permission remained closed.
  • New tests cover default/options conversion and rejection before setup, while initializing, without local replay opt-in, and during shutdown.
  • Independent read-only review found no issues. git diff --check passed.

Checklist

  • I reviewed the submitted code.
  • I added or updated tests where applicable.
  • I updated the documentation where needed.
  • I described any breaking changes and their migration path.

🤖 Agent context

Autonomy: Human-driven (agent-assisted)

Implemented with Pi using file-editing and shell tools, plus an independent read-only reviewer. The existing recorder remains owned by the game-instance subsystem; automatic and manual startup share the same implementation and capture gates. Requires human review.

@dustinbyrne
dustinbyrne requested a review from a team as a code owner October 26, 2026 20:15
@dustinbyrne dustinbyrne self-assigned this Oct 26, 2026

@marandaneto marandaneto left a comment

Copy link
Copy Markdown
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

The code looks good; no qualifying findings. Verdict: correct.

@dustinbyrne
dustinbyrne merged commit 9b0da4f into feat/rust-v1-embedding Oct 29, 2026
7 checks passed
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

Projects

None yet

Development

Successfully merging this pull request may close these issues.

2 participants