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

fix: session replay and auto capture works with 'with' method #217

Merged
merged 9 commits into from
Jan 28, 2025

Conversation

marandaneto
Copy link
Member

@marandaneto marandaneto commented Jan 27, 2025

💡 Motivation and Context

Closes #216

💚 How did you test it?

📝 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.

Comment on lines 75 to 80
// its not guaranteed that the posthog instance is set
if (postHog != null) {
events.capture(postHog)
} else {
// use static instance
events.capture()
Copy link
Member Author

Choose a reason for hiding this comment

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

important part is here

@@ -64,7 +64,7 @@ public final class com/posthog/android/replay/PostHogReplayIntegration : com/pos
public static final field ANDROID_COMPOSE_VIEW_CLASS_NAME Ljava/lang/String;
public static final field PH_NO_CAPTURE_LABEL Ljava/lang/String;
public fun <init> (Landroid/content/Context;Lcom/posthog/android/PostHogAndroidConfig;Lcom/posthog/android/internal/MainHandler;)V
public fun install ()V
public fun install (Lcom/posthog/PostHogInterface;)V
Copy link
Member Author

Choose a reason for hiding this comment

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

technically a breaking change but we don't document this integration API anywhere so its ok (we only use intergrations internally)

@marandaneto marandaneto changed the title fix fix: session replay and auto capture works with 'with' method Jan 27, 2025
@marandaneto marandaneto marked this pull request as ready for review January 27, 2025 20:04
@marandaneto marandaneto requested review from a team and ioannisj January 27, 2025 20:04
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.

🙌

Comment on lines +45 to +47
if (props.isNotEmpty()) {
postHog?.capture("Deep Link Opened", properties = props)
}
Copy link
Member Author

Choose a reason for hiding this comment

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

fly by fix, no event should be captured if we don't know where it comes from

@marandaneto marandaneto merged commit 91c7af5 into main Jan 28, 2025
5 checks passed
@marandaneto marandaneto deleted the fix/with-instance branch January 28, 2025 00:03
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.

Initing the SDK with the with method will break session replay and autocapture
2 participants