Github user chewbranca commented on a diff in the pull request:
https://github.com/apache/couchdb-couch/pull/144#discussion_r54172140
--- Diff: src/couch_changes.erl ---
@@ -221,21 +226,25 @@ configure_filter("_view", Style, Req, Db) ->
Msg = "`view` must be of the form `designname/viewname`",
throw({bad_request, Msg})
end;
-configure_filter([$_ | _], _Style, _Req, _Db) ->
+configure_filter([$_ | _], _Style, _Req, _Db, _) ->
throw({bad_request, "unknown builtin filter name"});
-configure_filter("", main_only, _Req, _Db) ->
+configure_filter("", main_only, _Req, _Db, _) ->
{default, main_only};
-configure_filter("", all_docs, _Req, _Db) ->
+configure_filter("", all_docs, _Req, _Db, _) ->
{default, all_docs};
-configure_filter(FilterName, Style, Req, Db) ->
+configure_filter(FilterName, Style, Req, Db, UseFetch) ->
FilterNameParts = string:tokens(FilterName, "/"),
case [?l2b(couch_httpd:unquote(Part)) || Part <- FilterNameParts] of
[DName, FName] ->
- DesignId = <<"_design/", DName/binary>>,
- {ok, DDoc} = ddoc_cache:open_doc(fabric:dbname(Db), DesignId),
+ {ok, DDoc} = open_ddoc(Db, <<"_design/", DName/binary>>),
check_member_exists(DDoc, [<<"filters">>, FName]),
- DIR = fabric_util:doc_id_and_rev(DDoc),
- {fetch, Style, Req, DIR, FName};
+ case UseFetch of
--- End diff --
Yeah sounds good to me. I wasn't a huge fan of adding `configure_filter/5`,
so happy to switch it around.
---
If your project is set up for it, you can reply to this email and have your
reply appear on GitHub as well. If your project does not have this feature
enabled and wishes so, or if the feature is enabled but not working, please
contact infrastructure at [email protected] or file a JIRA ticket
with INFRA.
---