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 [Talkable offerTargetFor:] #20

Open
ehyche opened this issue Jan 26, 2023 · 4 comments
Open

Crash in [Talkable offerTargetFor:] #20

ehyche opened this issue Jan 26, 2023 · 4 comments
Assignees
Labels
Bug Something isn't working

Comments

@ehyche
Copy link

ehyche commented Jan 26, 2023

We are seeing a crash in Crashlytics that looks like this:

Screenshot 2023-01-26 at 2 59 58 PM

The code in question is here:

- (TKBLOfferTarget*)offerTargetFor:(WKWebView*) webView {
    if (!_offerTargets) {
        _offerTargets = [NSMutableArray new];
    }
    for (TKBLOfferTarget* target in _offerTargets) {
        if (![target isUsed])
            [_offerTargets removeObject:target];
    }
    TKBLOfferTarget* target = [[TKBLOfferTarget alloc] initWithWebView:webView];
    [_offerTargets addObject:target];
    return target;
}

and it does indeed look like if [target isUsed] returns NO, then we will mutate the _offerTargets array while we are iterating it.

@dgtv
Copy link
Contributor

dgtv commented Jan 27, 2023

Hey @ehyche,
Thanks for the point and clear explanation.
Looks like there is indeed a bug in the SDK, but this is the first time we have it noticed.
We can arrange the fix to be made to the SDK in 3-4 week due to our development capacity and processes. Will it work for you?

@dgtv dgtv added the Bug Something isn't working label Jan 27, 2023
@ehyche
Copy link
Author

ehyche commented Jan 27, 2023

@dgtv : Thanks for the response! Sure, that will work. Thank you.

@ehyche
Copy link
Author

ehyche commented Feb 23, 2023

@dgtv : any update on this?

@dgtv
Copy link
Contributor

dgtv commented Feb 23, 2023

@ehyche Yes, thanks for the reminder. We already released the new version of SDK 1.4.15 yesterday with the bugfix and it is available from all distribution places listed in the documentation: https://docs.talkable.com/ios_sdk/getting_started.html.
Thanks for your contribution, we appreciate it.

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

No branches or pull requests

2 participants