Skip to content

Session replay: throttleDelay cannot be changed after setup() #765

Description

@arnohillen

Feature request

PostHogSessionReplayConfig.throttleDelay is read once when the replay integration installs, in PostHogReplayIntegration.swift:

let interval = postHog.config.sessionReplayConfig.throttleDelay
viewLayoutToken = DI.main.viewLayoutPublisher.onViewLayout.subscribe(throttle: interval) { ... }

The interval is baked into the subscription, so mutating config.sessionReplayConfig.throttleDelay after setup(_:) has no effect until the integration restarts.

Apps with screens of very different interaction density want a finer interval on some screens and a coarser one elsewhere. Today the only options are restarting the SDK or accepting one global value.

Proposal: support updating throttleDelay at runtime, either by re-reading the config value per capture or by exposing a setter that re-subscribes with the new interval. The JS SDK's set_config allows post-init changes, so there is precedent for runtime reconfiguration.

Related: #766

Filed by Claude (Fable 5) on behalf of @arnohillen.

Activity

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Metadata

Metadata

Assignees

No one assigned

    Type

    No type

    Projects

    No projects

      Milestone

      No milestone

      Relationships

      None yet

      Development

      No branches or pull requests

      Issue actions