jiahuili430 commented on code in PR #4862:
URL: https://github.com/apache/couchdb/pull/4862#discussion_r1443324913


##########
src/couch/src/couch_changes.erl:
##########
@@ -368,6 +395,17 @@ open_revs(Db, DocInfo, Style) ->
     OpenResults = [couch_db:open_doc(Db, DI, OpenOpts) || DI <- DocInfos],
     [Doc || {ok, Doc} <- OpenResults].
 
+open_revs2(Db, DocInfo) ->
+    DocInfos = [DocInfo#doc_info{revs = [R]} || R <- DocInfo#doc_info.revs],
+    OpenOpts = [deleted, conflicts],
+    OpenResults = [couch_db:open_doc(Db, DI, OpenOpts) || DI <- DocInfos],
+    Docs = [Doc || {ok, Doc} <- OpenResults],
+    [Doc1 | RestDocs] = Docs,
+    RestRevs = [Doc#doc.revs || Doc <- RestDocs],
+    Conflicts = [{conflicts, [{Pos, RevId} || {Pos, [RevId]} <- RestRevs]}],

Review Comment:
   It seems the `deleted_conflicts` parameter only exists in [`GET 
/{db}/{docid}`](https://docs.couchdb.org/en/latest/api/document/common.html#get--db-docid)
 endpoint.
   We can't use it in `_changes`.
   Added a filter in `RestRevs` to remove deleted conflict revs from the 
`_conflicts` field.
   Thank you for the review!



-- 
This is an automated message from the Apache Git Service.
To respond to the message, please log on to GitHub and use the
URL above to go to the specific comment.

To unsubscribe, e-mail: notifications-unsubscr...@couchdb.apache.org

For queries about this service, please contact Infrastructure at:
us...@infra.apache.org

Reply via email to