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

Crash in PostHogSessionManager.swift #302

Open
eareyereading opened this issue Feb 18, 2025 · 4 comments
Open

Crash in PostHogSessionManager.swift #302

eareyereading opened this issue Feb 18, 2025 · 4 comments
Labels
bug Something isn't working

Comments

@eareyereading
Copy link

Version

3.19.5

Steps to Reproduce

The stack trace for the cash is like this:

Image

The code that's causing the crash is in file PostHogReplayIntegration.swift at line 158.

private func resetViews() {
     windowViews.removeAllObjects()
}

When calling removeAllObjects on windowViews, the crash occurred.

Expected Result

No crash.

Actual Result

Crashed.

@eareyereading eareyereading added the bug Something isn't working label Feb 18, 2025
@ioannisj
Copy link
Contributor

Hey @eareyereading, thanx for reporting these couple of crashes. I'll take a look - but could you also share a snippet of how you initialize the SDK? I'm assuming this is done off the main thread, right?

@eareyereading
Copy link
Author

This is how I initialize the SDK. The initialization is done in method - (BOOL)application:(BRApplication *)application didFinishLaunchingWithOptions:(NSDictionary *)launchOptions

        let POSTHOG_HOST = @"https://us.i.posthog.com";
        let config = [[PostHogConfig alloc] apiKey:postHogAIPKey host:POSTHOG_HOST];
        config.sessionReplay = YES;
        config.sessionReplayConfig.maskAllTextInputs = NO;
        config.sessionReplayConfig.maskAllImages = NO;
        config.sessionReplayConfig.screenshotMode = YES;

        config.captureScreenViews = YES;
        config.captureApplicationLifecycleEvents = YES;
        config.captureElementInteractions = YES;
        [PostHogSDK.shared setup:config];

@ioannisj
Copy link
Contributor

Hey @eareyereading, thanx for the info. I see that this is from Crashlytics - any chance you can download and attach the stack trace for this and #303 as well?

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
bug Something isn't working
Projects
None yet
Development

No branches or pull requests

2 participants