Skip to content
This repository was archived by the owner on Sep 19, 2019. It is now read-only.
Open
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
10 changes: 9 additions & 1 deletion src/fabric_doc_open.erl
Original file line number Diff line number Diff line change
Expand Up @@ -48,7 +48,7 @@ go(DbName, Id, Options) ->
try fabric_util:recv(Workers, #shard.ref, fun handle_message/3, Acc0) of
{ok, #acc{}=Acc} ->
Reply = handle_response(Acc),
format_reply(Reply, SuppressDeletedDoc);
format_reply(Reply, SuppressDeletedDoc, Acc#acc.state);
Error ->
Error
after
Expand Down Expand Up @@ -156,6 +156,14 @@ choose_reply(Docs) ->
end, Docs),
{ok, Winner}.


format_reply({ok, Doc}, SupressDeleted, r_not_met) ->
Copy link
Copy Markdown
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

two p's in 'suppress'.

NewMeta = [r_not_met | Doc#doc.meta],
format_reply({ok, Doc#doc{meta=NewMeta}}, SupressDeleted);
format_reply(Else, SupressDeleted, _) ->
format_reply(Else, SupressDeleted).


format_reply({ok, #doc{deleted=true}}, true) ->
{not_found, deleted};
format_reply(Else, _) ->
Expand Down