You are viewing a plain text version of this content. The canonical link for it is here.
Posted to notifications@couchdb.apache.org by GitBox <gi...@apache.org> on 2022/07/14 15:31:58 UTC

[GitHub] [couchdb] nickva opened a new pull request, #4109: Clean up unused code and invalid spec from replicator

nickva opened a new pull request, #4109:
URL: https://github.com/apache/couchdb/pull/4109

   Invalid specs confused dialyzer.
   
   For bulk_docs response handling it detected another left-over clause from local endpoint support. 
   
   It also found unnecessarily broad case matches in `couch_replicator_auth_session`
   
   Based on @jaydoane and @chewbranca advice in https://github.com/apache/couchdb/pull/4103
   
   


-- 
This is an automated message from the Apache Git Service.
To respond to the message, please log on to GitHub and use the
URL above to go to the specific comment.

To unsubscribe, e-mail: notifications-unsubscribe@couchdb.apache.org

For queries about this service, please contact Infrastructure at:
users@infra.apache.org


[GitHub] [couchdb] nickva commented on a diff in pull request #4109: Clean up unused code and invalid specs from replicator

Posted by GitBox <gi...@apache.org>.
nickva commented on code in PR #4109:
URL: https://github.com/apache/couchdb/pull/4109#discussion_r921353311


##########
src/couch_replicator/src/couch_replicator_api_wrap.erl:
##########
@@ -898,39 +899,7 @@ json_to_doc_info({Props}) ->
             }
     end.
 
-bulk_results_to_errors(Docs, {ok, Results}, interactive_edit) ->

Review Comment:
   Yeah, it was code from when we had local end points and made couch_db:update_docs(...) calls directly.
   
   In dialyzer it was manifested as "this cannot match ..." errors then I did a search for `bulk_results_to_errors` and noticed we only called with the `remote` type. So removed the remote type and the local clauses



-- 
This is an automated message from the Apache Git Service.
To respond to the message, please log on to GitHub and use the
URL above to go to the specific comment.

To unsubscribe, e-mail: notifications-unsubscribe@couchdb.apache.org

For queries about this service, please contact Infrastructure at:
users@infra.apache.org


[GitHub] [couchdb] nickva commented on pull request #4109: Clean up unused code and invalid spec from replicator

Posted by GitBox <gi...@apache.org>.
nickva commented on PR #4109:
URL: https://github.com/apache/couchdb/pull/4109#issuecomment-1184591559

   From 19 warnings in https://github.com/apache/couchdb/pull/4103#issuecomment-1183578543 down to 2 only
   
   ```
   make dialyze apps=couch_replicator
   src/couch_replicator_doc_processor_worker.erl:43: The created fun has no local return
   src/couch_replicator_worker.erl:262: The created fun has no local return
   ```
   
   Not sure how to remove those easily, without refactoring those anonymous functions into functions and then add specs to them.


-- 
This is an automated message from the Apache Git Service.
To respond to the message, please log on to GitHub and use the
URL above to go to the specific comment.

To unsubscribe, e-mail: notifications-unsubscribe@couchdb.apache.org

For queries about this service, please contact Infrastructure at:
users@infra.apache.org


[GitHub] [couchdb] nickva commented on a diff in pull request #4109: Clean up unused code and invalid specs from replicator

Posted by GitBox <gi...@apache.org>.
nickva commented on code in PR #4109:
URL: https://github.com/apache/couchdb/pull/4109#discussion_r921353311


##########
src/couch_replicator/src/couch_replicator_api_wrap.erl:
##########
@@ -898,39 +899,7 @@ json_to_doc_info({Props}) ->
             }
     end.
 
-bulk_results_to_errors(Docs, {ok, Results}, interactive_edit) ->

Review Comment:
   Yeah, it was code from when we had local end points and made couch_db:update_docs(...) calls directly 



-- 
This is an automated message from the Apache Git Service.
To respond to the message, please log on to GitHub and use the
URL above to go to the specific comment.

To unsubscribe, e-mail: notifications-unsubscribe@couchdb.apache.org

For queries about this service, please contact Infrastructure at:
users@infra.apache.org


[GitHub] [couchdb] jaydoane commented on a diff in pull request #4109: Clean up unused code and invalid specs from replicator

Posted by GitBox <gi...@apache.org>.
jaydoane commented on code in PR #4109:
URL: https://github.com/apache/couchdb/pull/4109#discussion_r921351331


##########
src/couch_replicator/src/couch_replicator_api_wrap.erl:
##########
@@ -898,39 +899,7 @@ json_to_doc_info({Props}) ->
             }
     end.
 
-bulk_results_to_errors(Docs, {ok, Results}, interactive_edit) ->

Review Comment:
   Seems like this was dead code left over from a previous change?



-- 
This is an automated message from the Apache Git Service.
To respond to the message, please log on to GitHub and use the
URL above to go to the specific comment.

To unsubscribe, e-mail: notifications-unsubscribe@couchdb.apache.org

For queries about this service, please contact Infrastructure at:
users@infra.apache.org


[GitHub] [couchdb] nickva commented on a diff in pull request #4109: Clean up unused code and invalid specs from replicator

Posted by GitBox <gi...@apache.org>.
nickva commented on code in PR #4109:
URL: https://github.com/apache/couchdb/pull/4109#discussion_r921353311


##########
src/couch_replicator/src/couch_replicator_api_wrap.erl:
##########
@@ -898,39 +899,7 @@ json_to_doc_info({Props}) ->
             }
     end.
 
-bulk_results_to_errors(Docs, {ok, Results}, interactive_edit) ->

Review Comment:
   Yeah, it was code from when we had local end points and made couch_db:update_docs(...) calls directly.
   
   In dialyzer it was manifested as "this cannot match ..." errors then I did a search for `bulk_results_to_errors` and noticed we only called with the `remote` type. So removed the `remote` type variant as it's now the only variant and then removed the local clauses



-- 
This is an automated message from the Apache Git Service.
To respond to the message, please log on to GitHub and use the
URL above to go to the specific comment.

To unsubscribe, e-mail: notifications-unsubscribe@couchdb.apache.org

For queries about this service, please contact Infrastructure at:
users@infra.apache.org


[GitHub] [couchdb] nickva merged pull request #4109: Clean up unused code and invalid specs from replicator

Posted by GitBox <gi...@apache.org>.
nickva merged PR #4109:
URL: https://github.com/apache/couchdb/pull/4109


-- 
This is an automated message from the Apache Git Service.
To respond to the message, please log on to GitHub and use the
URL above to go to the specific comment.

To unsubscribe, e-mail: notifications-unsubscribe@couchdb.apache.org

For queries about this service, please contact Infrastructure at:
users@infra.apache.org