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 PingbackCollector #81

Closed
johnlo-bandlab opened this issue Jul 28, 2020 · 13 comments
Closed

Crash in PingbackCollector #81

johnlo-bandlab opened this issue Jul 28, 2020 · 13 comments

Comments

@johnlo-bandlab
Copy link

We have very few crash of this nature. I'm not sure if we cause this because it only started appearing a couple of weeks ago after months of using giphy.

Screen Shot 2020-07-28 at 11 10 37 AM

@cgmaier
Copy link
Contributor

cgmaier commented Jul 30, 2020

we dogfood the sdk in our GIPHY apps, and haven't identified any similar crashes. it could be a red herring?

@beamPacer
Copy link

Hey Chris! We've seen this same issue in TextNow -- here's a similar screenshot from Fabric. I came here to report it and see that there's already this thread! Yay. Let us know if you need more information.

giphy crash

@beamPacer
Copy link

I looked at our metrics and it appears that there's a 10:1 ratio between the number of users who successfully sent a gif from Giphy to the number of crashes we're seeing with this signature. Those numbers are only mostly correlated, of course.

@cgmaier
Copy link
Contributor

cgmaier commented Aug 11, 2020

hopeful fix for the latest release:

https://github.com/Giphy/giphy-ios-sdk-ui-example/releases/tag/v2.0

has anyone been able to reproduce or gotten any outreach from users that verify this issue? 10:1 seems like a fairly significant ratio, considering we can't seem to reproduce it ourselves.

@beamPacer
Copy link

We're working on reproducing it in-house and will let you know -- thanks as always for the quick response! I'm wondering if it happens on initialize -- if so it would look the same as any other crash to our users, and the ratio of all of our users to the number of crashes with this signature is significantly lower than 10:1.

@johnlo-bandlab
Copy link
Author

johnlo-bandlab commented Aug 12, 2020

We started encountering this crash when we move things around in our project resulting on us calling Giphy.configure(apiKey: "ourkey") multiple times, everytime we open our chat feature.

@cgmaier
Copy link
Contributor

cgmaier commented Aug 24, 2020

an update here: as @johnlo-bandlab has suggested, this crash seems to result from multiple calls to Giphy.configure(apiKey: "apiKey").

I did a deep dive in the code today and found that configure ends up creating a new serial dispatch queue every time it is called, and loses the reference to any previously active queue as a result.

we have a seemingly innocuous line in that configure function which does something like PingbackCollector.apiKey = apiKey. it wasn't apparent to me that apiKey is a computed var, and so its setter goes and does a bunch of stuff, including allocate that new dispatch queue...

we weren't able to find any crashes similar to this in the GIPHY iOS App, which "dogfoods" this SDK and only ever calls configure once in the app life cycle.

we'll be sure to prevent multiple configure calls from causing any issues in a future release, but in the meantime, ensure configure is only ever called once in a given app lifecycle. also avoid using the GiphyViewController method setAPIKey for now.

thanks all for the patience on this! cc @beamPacer

@beamPacer
Copy link

Mm, ok -- thinking about this more, our static once call to configure would still be called every time a new instance of the class is initialized, which explains why instances of this crash went down but stayed around after we made that change. Ok! We'll go in and verify that it only ever happens exactly once no matter what.

@johnlo-bandlab
Copy link
Author

@cgmaier , Our app just got release 3 days ago so I can't fully verify yet that it fixed the issue. So far there's no instance of crash when we call configure only once. thanks for all the help. 👍

@beamPacer
Copy link

We haven't seen this crash occur in our release which only calls configure once. Thanks again Chris!

@cgmaier
Copy link
Contributor

cgmaier commented Sep 3, 2020

that's awesome! thanks for the follow up. will close this issue : )

@cgmaier cgmaier closed this as completed Sep 3, 2020
@mmdock
Copy link

mmdock commented Sep 3, 2020

we'll be sure to prevent multiple configure calls from causing any issues in a future release, but in the meantime, ensure configure is only ever called once in a given app lifecycle. also avoid using the GiphyViewController method setAPIKey for now.

@cgmaier

quick question, you write "we'll be sure to prevent multiple configure calls from causing any issues in a future release, but in the meantime, ensure configure is only ever called once in a given app lifecycle. also avoid using the GiphyViewController method setAPIKey for now." However, I have seen no new version that actually fixes this, the solution seems to be that end developers should just not call it multiple times. So, in my code implementation, I do call setAPIKey for each instance of GiphyViewController . Am I right to assume that the issue is that i shouldn't call setAPIKey multiple times for the same instance, or should I just not use it altogether?

code implementation below, currently in a beta release of my application:
Screen Shot 2020-09-03 at 12 12 18 PM

@cgmaier
Copy link
Contributor

cgmaier commented Sep 3, 2020

hey @mmdock with the latest release 2.0.2, multiple calls to configure or setAPIKey won't cause issues

djrluna pushed a commit that referenced this issue Apr 21, 2021
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

No branches or pull requests

4 participants