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));
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.


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

It’s fine now, thanks.