pilgr / Paper

Paper is a fast NoSQL-like storage for Java/Kotlin objects on Android with automatic schema migration support.
Apache License 2.0
2.35k stars 234 forks source link

crash during 1.5 => 2.1 transition #87

Closed martinbonnin closed 7 years ago

martinbonnin commented 7 years ago

I made a small android app to reproduce there: https://github.com/martinbonnin/TestPaper

it fails with:

    Caused by: com.esotericsoftware.kryo.KryoException: Encountered unregistered class ID: 99
    Serialization trace:
    ingredients (testpaper.mbonnin.net.testpaper.Recipe)
    mContent (io.paperdb.PaperTable)
    at com.esotericsoftware.kryo.util.DefaultClassResolver.readClass(DefaultClassResolver.java:137)
pilgr commented 7 years ago

What I found for now is crash happens not because of Kryo update bu because of update de.javakaffee:kryo-serializers:0.33 -> 0.40

pilgr commented 7 years ago

My previous assumption was wrong. Crash happens after update com.esotericsoftware:kryo:3.0.3->4.0.0. (previously lesser kryo version didn't take effect because of transitive dependency for kryo-serializers)

pilgr commented 7 years ago

you were right, thanks! changing getFieldSerializerConfig().setOptimizedGenerics for existing kryo instance doesn't take effect. Using new temporary kryo object in compatibility mode solves the issue. Fix is on the way.

pilgr commented 7 years ago

Fixed in https://github.com/pilgr/Paper/commit/408164c8dc2153b60df92b6c0e66471026b4648d (forgot to mention in commit message)

martinbonnin commented 7 years ago

Thanks ! Do you know when the next release is planned ? As far as I'm concerned, the sooner, the better as I'm stuck on 1.5 with the potential crash on Android N for now.

pilgr commented 7 years ago

I hope to make it today or tomorrow.

On Thursday, September 21, 2017 at 12:54, Martin Bonnin wrote:

Thanks ! Do you know when the next release is planned ? As far as I'm concerned, the sooner, the better as I'm stuck on 1.5 with the potential crash on Android N for now.

— You are receiving this because you modified the open/close state. Reply to this email directly, view it on GitHub (https://github.com/pilgr/Paper/issues/87#issuecomment-331109679), or mute the thread (https://github.com/notifications/unsubscribe-auth/AAaNIV6ZXYxMl1Lm0P599GBkOtVL8Ucaks5skjJDgaJpZM4Pc7pg).

martinbonnin commented 7 years ago

Awesome, thanks !

pilgr commented 7 years ago

Could you check out new version 2.5? It’s already published to the maven repo but not yet released publicly. Thanks!

//Aleksey Masny Sent with Sparrow (http://www.sparrowmailapp.com/?sig)

On Thursday, September 21, 2017 at 13:02, Martin Bonnin wrote:

Awesome, thanks !

— You are receiving this because you modified the open/close state. Reply to this email directly, view it on GitHub (https://github.com/pilgr/Paper/issues/87#issuecomment-331111751), or mute the thread (https://github.com/notifications/unsubscribe-auth/AAaNIc4ztL1Ecf_FiI-pzqqppNRggAUcks5skjRGgaJpZM4Pc7pg).

martinbonnin commented 7 years ago

Works fine, thanks!