Git Product home page Git Product logo

Comments (8)

jkichline avatar jkichline commented on August 16, 2024

Basically if appUserID is nil, it causes a crash as a method appends the appUserID to a base key. If it's nil, that crashes... so I just check for the presence of an appUserId to prevent the crash.

from purchases-ios.

jeiting avatar jeiting commented on August 16, 2024

Hey! We'll look into this right away.

What do you mean by "clearing NSUserDefaults"?

The SDK should work with a blanked out NSUserDefaults.

from purchases-ios.

jkichline avatar jkichline commented on August 16, 2024

Hey thanks! Well we have a "Reset Settings" tool in our app that goes through NSUserDefaults and clears it out so I'm not really sure what caused that appUserId to become blank in the process. Maybe it stores that in NSUserDefaults, but the SDK state was still thinking it had one, I'm not sure exactly.

from purchases-ios.

jeiting avatar jeiting commented on August 16, 2024

Ok, so this crashed during the same session as when you cleared the defaults?

Restarting the app, everything worked ok yea? Just want to make sure we understand the severity of the issue.

We hadn't considered somebody deleting our cache keys from underneath us mid-session.

from purchases-ios.

jkichline avatar jkichline commented on August 16, 2024

Yes, once it was restarted it works fine. Understood, the "pulling the rug out from underneath you" part probably wasn't expected ;) But just adding a little check when appending the appUserId to make sure it isn't nil first would probably be easy defensive coding.

from purchases-ios.

aboedo avatar aboedo commented on August 16, 2024

@jkichline Sorry for the delay in responding. We're looking into moving out of NSUserDefaults and into another form of storage that's specific to the SDK so that we prevent this kind of collision in the future. We'll keep this issue open until we have a fix for this. Thanks for reporting!

from purchases-ios.

aboedo avatar aboedo commented on August 16, 2024

replied on #156, you should be able to pass in a different UserDefaults instance for RevenueCat to use and this issue shouldn't happen anymore.

from purchases-ios.

aboedo avatar aboedo commented on August 16, 2024

closing as a duplicate of #156

from purchases-ios.

Related Issues (20)

Recommend Projects

  • React photo React

    A declarative, efficient, and flexible JavaScript library for building user interfaces.

  • Vue.js photo Vue.js

    🖖 Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.

  • Typescript photo Typescript

    TypeScript is a superset of JavaScript that compiles to clean JavaScript output.

  • TensorFlow photo TensorFlow

    An Open Source Machine Learning Framework for Everyone

  • Django photo Django

    The Web framework for perfectionists with deadlines.

  • D3 photo D3

    Bring data to life with SVG, Canvas and HTML. 📊📈🎉

Recommend Topics

  • javascript

    JavaScript (JS) is a lightweight interpreted programming language with first-class functions.

  • web

    Some thing interesting about web. New door for the world.

  • server

    A server is a program made to process requests and deliver data to clients.

  • Machine learning

    Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.

  • Game

    Some thing interesting about game, make everyone happy.

Recommend Org

  • Facebook photo Facebook

    We are working to build community through open source technology. NB: members must have two-factor auth.

  • Microsoft photo Microsoft

    Open source projects and samples from Microsoft.

  • Google photo Google

    Google ❤️ Open Source for everyone.

  • D3 photo D3

    Data-Driven Documents codes.