Coder Social home page Coder Social logo

Comments (4)

alexkarpenko avatar alexkarpenko commented on August 25, 2024

My current workaround is to add a try-catch to unarchiveEvents, and remove the event file if the unarchiver fails:

- (void)unarchiveEvents {
    @try {
        self.eventQueue = [NSKeyedUnarchiver unarchiveObjectWithFile:[self eventFilePath]];
    }
    @catch (NSException *exception) {
        [[NSFileManager defaultManager] removeItemAtPath:[self eventFilePath] error:nil];
        self.eventQueue = nil;
    }

    if (!self.eventQueue) {
        self.eventQueue = [NSMutableArray array];
    }
}

from mixpanel-iphone.

kasrak avatar kasrak commented on August 25, 2024

Hey,

Thanks for reporting this. I've put the try-catches in the unarchive methods. That should prevent any more app crashes.

I'm wondering how this could've happened. Were you updating from a previous version of the library or was this a brand new implementation?

from mixpanel-iphone.

alexkarpenko avatar alexkarpenko commented on August 25, 2024

Hay kasrak,

A few of our users ran into this while using our live app store version. Our app store version has an older mixpanel SDK (preceding the people additions). I got a tester who experienced this issue to run a fresh build with the above SHA version, and got that crash report back.

Unfortunately all I have are guesses as to the cause, since I can't reproduce this myself. The tester reported running out of disk space while using our app, after which point the app would crash on launch. Perhaps the archive operation leaves the file in a corrupt state when there's not enough disk space. I also store some error data (error domain, code, description) in properties which might might have been malformed somehow. How does NSKeyedArchiver deal with objects that don't implement NSCoding?

from mixpanel-iphone.

malectro avatar malectro commented on August 25, 2024

Sounds like we're a go with the try/catches, and we haven't had any reported issues with the KeyedArchiver in the meantime. Please feel free to reopen if you're experiencing more issues with it.

from mixpanel-iphone.

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.