Skip to content

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

Merged
marandaneto merged 9 commits intomainfrom
fix/with-instance
Jan 28, 2025
Merged

fix: session replay and auto capture works with 'with' method#217
marandaneto merged 9 commits intomainfrom
fix/with-instance

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

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
4 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