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: respects the flushAt flag #13

Merged
merged 2 commits into from
Nov 19, 2024
Merged

fix: respects the flushAt flag #13

merged 2 commits into from
Nov 19, 2024

Conversation

marandaneto
Copy link
Member

@marandaneto marandaneto commented Nov 19, 2024

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.

👍

@@ -46,11 +46,17 @@ class PosthogReactNativeSessionReplayModule(reactContext: ReactApplicationContex
val anonymousId = sdkOptions.getString("anonymousId") ?: ""
val theSdkVersion = sdkOptions.getString("sdkVersion")

var theFlushAt = 20
if (sdkOptions.hasKey("flushAt")) {
theFlushAt = sdkOptions.getInt("flushAt")
Copy link
Contributor

Choose a reason for hiding this comment

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

Can this throw here if not an Int?

Copy link
Member Author

Choose a reason for hiding this comment

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

yes but this is passed by the SDK and declared as a number so it's safe, similar to androidDebouncerDelayMs, the JS code always swallows exceptions and logs to the console as well.

@marandaneto marandaneto merged commit f337576 into main Nov 19, 2024
5 checks passed
@marandaneto marandaneto deleted the fix/flushat branch November 19, 2024 12:32
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.

3 participants