summaryrefslogtreecommitdiff
path: root/apps
diff options
context:
space:
mode:
authorAdam Kocoloski <adam@cloudant.com>2010-08-20 16:34:30 -0400
committerAdam Kocoloski <adam@cloudant.com>2010-08-27 16:34:31 -0400
commitef97f6583d5c6be6d0319a2367c4388426d04e82 (patch)
tree1afa911f6ee4b5818c1fdba6615950641f78b1ee /apps
parent8427ebd948b142331de0883b6c3b7d03de479d9b (diff)
fix "Mike's bug" with attachment uploading. BugzID 10742
Diffstat (limited to 'apps')
-rw-r--r--apps/fabric/src/fabric_doc_open_revs.erl12
1 files changed, 8 insertions, 4 deletions
diff --git a/apps/fabric/src/fabric_doc_open_revs.erl b/apps/fabric/src/fabric_doc_open_revs.erl
index cef37244..8dbd1aba 100644
--- a/apps/fabric/src/fabric_doc_open_revs.erl
+++ b/apps/fabric/src/fabric_doc_open_revs.erl
@@ -62,10 +62,14 @@ merge_read_reply(Key, Reply, Replies) ->
{lists:keyreplace(Key, 1, Replies, {Key, Reply, N+1}), N+1}
end.
-make_key({ok, #doc{id=Id, revs=Revs}}) ->
- {Id, Revs};
-make_key(Else) ->
- Else.
+make_key({ok, L}) when is_list(L) ->
+ make_key(L);
+make_key([]) ->
+ [];
+make_key([{ok, #doc{revs= {Pos,[RevId | _]}}} | Rest]) ->
+ [{ok, {Pos, RevId}} | make_key(Rest)];
+make_key([{{not_found, missing}, Rev} | Rest]) ->
+ [{not_found, Rev} | make_key(Rest)].
repair_read_quorum_failure(Replies) ->
case [Doc || {_Key, {ok, Doc}, _Count} <- Replies] of