Code Monkey home page Code Monkey logo

Comments (3)

franmontiel avatar franmontiel commented on August 18, 2024

The problem here is that the cookies returned shouldn't be null, so making the null check would be a workaround but will not solve the problem. I will try to reproduce the issue and see why the null cookies are appearing, if you have any fixed steps to reproduce the issue it will be appreciated.

from persistentcookiejar.

malvinstn avatar malvinstn commented on August 18, 2024

I can reproduce the error though it's a very edge case.
The problem was because I was using the previous version of the library w/ okhttp2 which serialized SerializedHttpCookie under the old class.
When upgrading to okhttp3 with this library, since I'm using the same SharedPreference, it's still taking the byte data of the old Cookie and tried to serialize it to the new SerializableCookie.
It throws ClassNotFoundException and returns null during SerializableCookie.decode()

This error might also happen if someone use the same SharedPreference for their cookie and data.

IMO, null check is still required since the code SerializableCookie.decode might return null.
Either that, or throw a RuntimeException which clearly indicates why the deserialization has failed.

from persistentcookiejar.

franmontiel avatar franmontiel commented on August 18, 2024

Null check merged, thanks for your contribution

from persistentcookiejar.

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.