Skip to first unread message

Brian Hardy

unread,
Feb 6, 2014, 2:20:54 PM2/6/14
to mobile-c...@googlegroups.com


Hello,

I have an iOS Titanium client built using the couchbaseLite titanium iOS module. Pull and Push replication is configured and working well in general, however I noticed a problem. If I update the same json document via the sync gateway using a REST PUT command two times in a row, the second time the document is updated, the CHANGE_EVENT is not received in the javascript listener callback. I see that the emitter map is accessed but the callback is not invoked. If I update another different document after updating a first document, then I can receive the CHANGE_EVENT successfully in the callback each time. It's only when I try to update the SAME document two times in succession that I do not get the CHANGE_EVENT. Tomorrow I'm going to begin to try to see some logging information about why this is happening. Any ideas or tips on how to see the logs for this? Does it sound like this might be an issue in the Titanium IOS module, or possibly the iOS CouchbaseLite code or maybe the sync_gateway?

Here is how I see this issue: In a terminal I run curl -u user:password -X GET http://myhost.compute-1.amazonaws.com:4984/sync_gateway/session:100. This returns my data like this: {"_id":"session:100","_rev":"25-e6f75cb8c030d7cf660fcfbb6b1d5a35","ab":"JS _proto","title":"Prototyping JS The Right Way","type":"session"}

Next I update the data with using the same _rev number in a PUSH like this: curl -X PUT -H 'Content-Type: application/json' http://user:pass...@myhost.compute-1.amazonaws.com:4984/sync_gateway/session:100 -d '{"title":"Name Change - Prototyping JS The Only Way", "type":"session", "ab":"JS _proto", "_rev":"25-e6f75cb8c030d7cf660fcfbb6b1d5a35"}'

The update works great and in my debugger I receive the CHANGE_EVENT in my code. If I repeat the same process again and get the new revision number and update the data to have a different title I do not receive the CHANGE_EVENT in my code. Each time however I can see in the debugger that my emitter mapping code is processed.

Thanks for any insight and help.

- See more at: http://www.couchbase.com/communities/q-and-a/changeevent-not-received#sthash.wX1ogGkv.dpuf
Reply all
Reply to author
Forward
0 new messages