Long value on document changed after saved to db

Hi, I’m using couchbase lite 2.0 for Android. Take a look at this, after these 3 lines:

Log.d(TAG, "insert: before " + newTask.getLong(myId));
mDatabase.save(newTask);
Log.d(TAG, “insert: after” + newTask.getLong(myId));

Outputs for example:

insert: before 11989091
insert: after -4788125

insert: before 231548688
insert: after 0

But there are many other long that works. Can you help with this?

That’s almost certainly an encoder bug that was fixed on August 23rd. I don’t know which version of CBL Android incorporates the fix, but I would think it’s fixed in the latest build. (@hideki?) What build are you using?

Hi @itai.shalom2,

What DB version of CBL 2.0.0 are you using? Latest build (DB017) is built with the latest litecore module which has this fix.

I added another unit test with the value you are using. Latest code can handle these large long values.
https://github.com/couchbase/couchbase-lite-android/blob/feature/2.0/android/CouchbaseLite/src/androidTest/java/com/couchbase/lite/DictionaryTest.java#L386-L399

Thanks

The fix is already in DB16; I just verified this.

It’s fine now, thanks.