Skip to content

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

Open

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

  1. marandaneto commented on Aug 14, 2026

    @marandaneto
    Member

    this would be a bigger change, the options are immutable by design, if we want to change this, we'd have to make the whole config mutable, and this is an issue for all features that depend on eg swizzling, once you swizzle, you can't unswizzle without side effects

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