Skip to content
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

Do not capture console logs and network requests if session replay and session are not active #83

Merged
merged 3 commits into from
Jan 17, 2024

Conversation

marandaneto
Copy link
Member

@marandaneto marandaneto commented Jan 17, 2024

💡 Motivation and Context

If session replay was disabled or session not active, console logs and network requests were still captured since the check was done only early in the app lifecycle.

💚 How did you test it?

Running both with session replay and session active and not active

📝 Checklist

  • I reviewed the submitted code.
  • I added tests to verify the changes.
  • I updated the docs if needed.
  • No breaking change or entry added to the changelog.

@marandaneto marandaneto marked this pull request as ready for review January 17, 2024 13:06
@marandaneto marandaneto requested a review from a team January 17, 2024 13:06
import com.posthog.android.PostHogAndroidConfig
import com.posthog.internal.interruptSafely
import com.posthog.internal.replay.RRPluginEvent
import com.posthog.internal.replay.capture
import java.text.SimpleDateFormat
import java.util.Locale

internal class PostHogLogCatWatcher(private val config: PostHogAndroidConfig) {
internal class PostHogLogCatIntegration(private val config: PostHogAndroidConfig) : PostHogIntegration {
Copy link
Member Author

Choose a reason for hiding this comment

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

the logcat integration now is totally decoupled from the app lifecycle and session replay integration, its installed but only captures something if the session is active and replay is enabled

Copy link
Member

@pauldambra pauldambra left a comment

Choose a reason for hiding this comment

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

:shipit:

@marandaneto marandaneto merged commit 2ede6a5 into main Jan 17, 2024
5 checks passed
@marandaneto marandaneto deleted the fix/console-network-donot-capture branch January 17, 2024 14:30
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

2 participants