Unable to get the current revision id of the document in 2.6

I have upgraded the CB Lite version to 2.6 and my main intention was to get the revision ID changes added in 2.6 w.r.t 2.5. But when I try to access the revision id value using document.revisionID its returns nilwhen I reveive the document through pushfilter block. I could see the revision ids of that document using cblite tool. Is there any reason for this issue with pushfilter?

config.pushFilter = { (document, _) in
   print(document.revisionID) // nil

This could be a CBL bug. A Document object passed to a filter is constructed differently than one that you explicitly read from the database. Maybe the code that handles the push filter doesn’t store the revision ID into the object?

Any ideas, @jayahari.vavachan ?

Yea, seems like filters are creating the CBLDocument without the C4Doc instance. So when getting the RevisionID from the C4Doc, returns nil.

Created this issue to track CBL-498

Thanks @jayahari.vavachan @jens for the reply and initiative to resolve the issue. Now I did a work around by accessing the revision id of the document from the DB with the available document id from the filter block.

Curious about your use case for accessing the revisionId of the document from within the filter block.

We are creating some documents from app and keeping its draft until it matches to a specific document state. So we wanted to log the pushed document Id and revision Id to see the last edit done on that document from app. The same document can be updated by middleware services too. This was added to see the document update cycle in order to track some issues.

Can’t you use a status field for that? Similar to pattern4 in this blog

if you try fetching the revision-id from the db inside the filter, it might not be same as one which you trying to push to SGW. Since between the time you made the changes, and when replicator tries to send, the same document can be changed by another process(resulting in a new revision-id to same document).

Until we push the document its there in our draft and my assumption is all the edit should be happening from client side. Any other possibility you can think of @jayahari.vavachan?

Can you provide us a concrete example of the problem you are trying to solve (sorry but from that use case description, that wasn’t clear to me. An example of sequence of operations would be preferred). Maybe there are alternative approaches to solving that…