summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorJan Lehnardt <jan@apache.org>2022-08-20 11:55:47 +0200
committerJan Lehnardt <jan@apache.org>2022-12-16 16:56:18 +0100
commit6d437e339a402321f7e2b85da536badacda8c109 (patch)
tree805ab6fc41c4c69c20157c6b1d15d3ef9d53fb46
parentd6863a73f9be7e01a28939f983e2fe072ffe2f7f (diff)
downloadcouchdb-6d437e339a402321f7e2b85da536badacda8c109.tar.gz
chore: remove comments and stale todo entries
-rw-r--r--src/chttpd/src/chttpd_view.erl14
-rw-r--r--src/couch/src/couch_db_updater.erl16
-rw-r--r--src/couch/src/couch_doc.erl4
3 files changed, 1 insertions, 33 deletions
diff --git a/src/chttpd/src/chttpd_view.erl b/src/chttpd/src/chttpd_view.erl
index 44459b3cf..25c6b6d03 100644
--- a/src/chttpd/src/chttpd_view.erl
+++ b/src/chttpd/src/chttpd_view.erl
@@ -69,20 +69,6 @@ fabric_query_view(Db, Req, DDoc, ViewName, Args) ->
Max = chttpd:chunked_response_buffer_size(),
VAcc = #vacc{db = Db, req = Req, threshold = Max},
Options = [{user_ctx, Req#httpd.user_ctx}],
- % {ok, Resp} = fabric:query_view(Db, Options, DDoc, ViewName,
- % fun view_cb/2, VAcc, Args),
- % {ok, Resp#vacc.resp}.
- % % TODO: This might just be a debugging leftover, we might be able
- % % to undo this by just returning {ok, Resp#vacc.resp}
- % % However, this *might* be here because we need to handle
- % % errors here now, because access might tell us to.
- % case fabric:query_view(Db, Options, DDoc, ViewName,
- % fun view_cb/2, VAcc, Args) of
- % {ok, Resp} ->
- % {ok, Resp#vacc.resp};
- % {error, Error} ->
- % throw(Error)
- % end.
{ok, Resp} = fabric:query_view(
Db,
diff --git a/src/couch/src/couch_db_updater.erl b/src/couch/src/couch_db_updater.erl
index 02136d83b..d62485d31 100644
--- a/src/couch/src/couch_db_updater.erl
+++ b/src/couch/src/couch_db_updater.erl
@@ -267,7 +267,7 @@ sort_and_tag_grouped_docs(Client, GroupedDocs) ->
% check we sort them again here. See COUCHDB-2735.
Cmp = fun
% TODO: re-evaluate this addition, might be
- ([], []) -> false;
+ %([], []) -> false;
% superflous now
([#doc{id = A} | _], [#doc{id = B} | _]) -> A < B
end,
@@ -736,14 +736,10 @@ update_docs_int(Db, DocsList, LocalDocs, MergeConflicts, UserCtx) ->
%. if invalid, then send_result tagged `access`(c.f. `conflict)
%. and don’t add to DLV, nor ODI
- %couch_log:notice("~nDb: ~p, UserCtx: ~p~n", [Db, UserCtx]),
-
{DocsListValidated, OldDocInfosValidated} = validate_docs_access(
Db, UserCtx, DocsList, OldDocInfos
),
- %couch_log:notice("~nDocsListValidated: ~p, OldDocInfosValidated: ~p~n", [DocsListValidated, OldDocInfosValidated]),
-
{ok, AccOut} = merge_rev_trees(DocsListValidated, OldDocInfosValidated, AccIn),
#merge_acc{
add_infos = NewFullDocInfos,
@@ -783,11 +779,6 @@ update_docs_int(Db, DocsList, LocalDocs, MergeConflicts, UserCtx) ->
{ok, commit_data(Db1), UpdatedDDocIds}.
-% check_access(Db, UserCtx, Access) ->
-% check_access(Db, UserCtx, couch_db:has_access_enabled(Db), Access).
-%
-% check_access(_Db, UserCtx, false, _Access) ->
-% true;
% at this point, we already validated this Db is access enabled, so do the checks right away.
check_access(Db, UserCtx, Access) -> couch_db:check_access(Db#db{user_ctx = UserCtx}, Access).
@@ -810,11 +801,8 @@ validate_docs_access(
% validate Doc
% if valid, then put back in Docs
% if not, then send_result and skip
- %couch_log:notice("~nvalidate_docs_access() UserCtx: ~p, Docs: ~p, OldInfo: ~p~n", [UserCtx, Docs, OldInfo]),
NewDocs = lists:foldl(
fun({Client, Doc}, Acc) ->
- %couch_log:notice("~nvalidate_docs_access lists:foldl() Doc: ~p Doc#doc.access: ~p~n", [Doc, Doc#doc.access]),
-
% check if we are allowed to update the doc, skip when new doc
OldDocMatchesAccess =
case OldInfo#full_doc_info.rev_tree of
@@ -823,8 +811,6 @@ validate_docs_access(
end,
NewDocMatchesAccess = check_access(Db, UserCtx, Doc#doc.access),
- %couch_log:notice("~nvalidate_docs_access lists:foldl() OldDocMatchesAccess: ~p, NewDocMatchesAccess: ~p, andalso: ~p~n", [OldDocMatchesAccess, NewDocMatchesAccess, OldDocMatchesAccess andalso NewDocMatchesAccess]),
-
case OldDocMatchesAccess andalso NewDocMatchesAccess of
% if valid, then send to DocsListValidated, OldDocsInfo
true ->
diff --git a/src/couch/src/couch_doc.erl b/src/couch/src/couch_doc.erl
index dec3301d4..acf4994a3 100644
--- a/src/couch/src/couch_doc.erl
+++ b/src/couch/src/couch_doc.erl
@@ -50,10 +50,6 @@ to_json_rev(0, []) ->
to_json_rev(Start, [FirstRevId | _]) ->
[{<<"_rev">>, ?l2b([integer_to_list(Start), "-", revid_to_str(FirstRevId)])}].
-% TODO: remove if we can
-% to_json_body(Del, Body) ->
-% to_json_body(Del, Body, []).
-
to_json_body(true, {Body}, []) ->
Body ++ [{<<"_deleted">>, true}];
to_json_body(false, {Body}, []) ->