This occurs with both the android and ios SDKs on db23:
1)Set up two devices with couchbase using PULL only replication.
2)Sync down the database on both devices. At this point, all documents are available on both devices
3)On device 1, update a document (for example, change the value of an email field) via the Sync Gateway REST API (we can’t use PUSH replication because our validation logic is too complex for the sync gateway’s validate hook).
4)On device 2, use PULL replication to pull down the new changes. Notice that the document updated by device 1 is truncated- the document will exist and will not be deleted, but it will have no fields.
This will be the case even if you uninstall and reinstall the app, starting with a fresh installation- the initial sync will have a truncated document.
When looking at it on the Couchbase server, the document has data. When querying it via the REST API for use on web, the document has data.
Example of one of those documents on the server:
SELECT *, meta() FROM data WHERE email LIKE “barb%”
[
{
"$1": {
"cas": 1523467936225034240,
"expiration": 0,
"flags": 33554432,
"id": "648f0f18-cc8a-4150-8e9f-cb56239e58eb",
"type": "json"
},
"data": {
"$schema": "",
"_sync": {
"cas": "",
"channels": {
"Demo": {
"rev": "2-31c7ccc90fa7011d9757d2b61b658eb0",
"seq": 27
}
},
"history": {
"channels": [
null,
[
"Demo"
],
null
],
"parents": [
2,
-1,
1
],
"revs": [
"3-6717498ab5a8a0b8a61001c5df18f961",
"1-e91e28f561027aa8f8e631ae194d2e14",
"2-31c7ccc90fa7011d9757d2b61b658eb0"
]
},
"recent_sequences": [
7,
27,
28
],
"rev": "3-6717498ab5a8a0b8a61001c5df18f961",
"sequence": 28,
"time_saved": "2018-04-09T18:04:09.901965149Z"
},
"email": "barbara@yaplc.com",
"hs": {
"account": "Demo",
"channels": [],
"create": [
"Demo@REP",
"Demo@DIRECT"
],
"ctime": "2018-04-09T18:04:09.877Z",
"cuser": "buyer@customer.com",
"delete": [
"Demo@REP",
"Demo@DIRECT"
],
"mtime": "2018-04-09T18:04:09.877Z",
"muser": "buyer@customer.com",
"type": "Demo::Customer",
"update": [
"Demo@REP",
"Demo@DIRECT"
],
"version": 1
},
"name": "Thomas PLC",
"uuid": "648f0f18-cc8a-4150-8e9f-cb56239e58eb"
}
}
]
Any help is appreciated, this is a showstopping bug.