Skip to content
This repository was archived by the owner on May 25, 2021. It is now read-only.

Commit 81b8eb1

Browse files
committed
Set proper rev for processed deleted doc
View changes needs to return the "winning" rev to the client. With default style, it does this by looking up the rev in the seq tree. Prior to this commit, when a document was being deleted, the default rev (ie. {0, []}) would be added to the seq tree. This commit fixes the problem by manually setting the proper rev in the deleted #doc record before it's processed.
1 parent 7acb7d3 commit 81b8eb1

File tree

1 file changed

+3
-1
lines changed

1 file changed

+3
-1
lines changed

src/couch_index_updater.erl

Lines changed: 3 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -159,7 +159,9 @@ update(Idx, Mod, IdxState) ->
159159
{false, <<"_design/", _/binary>>} ->
160160
{nil, Seq};
161161
_ when Deleted ->
162-
{#doc{id=DocId, deleted=true}, Seq};
162+
[RI|_] = DocInfo#doc_info.revs,
163+
{Pos, Rev} = RI#rev_info.rev,
164+
{#doc{id=DocId, revs={Pos, [Rev]}, deleted=true}, Seq};
163165
_ ->
164166
{ok, Doc} = couch_db:open_doc_int(Db, DocInfo, DocOpts),
165167
{Doc, Seq}

0 commit comments

Comments
 (0)