nickva commented on code in PR #5881:
URL: https://github.com/apache/couchdb/pull/5881#discussion_r2790758617


##########
src/couch_replicator/src/couch_replicator_ids.erl:
##########
@@ -120,7 +120,15 @@ maybe_append_filters(
                 true ->
                     [<<"winning_revs_only">>]
             end,
-    couch_util:to_hex(couch_hash:md5_hash(?term_to_bin(Base3))).
+    Base4 =

Review Comment:
   For coverage might be a good idea to add a few tests in this module some 
with and without since_seq ensuring we get a new revid on a since_seq.



##########
src/couch_replicator/src/couch_replicator_scheduler_job.erl:
##########
@@ -685,7 +685,20 @@ init_state(Rep) ->
     Stats = couch_replicator_stats:max_stats(ArgStats1, HistoryStats),
 
     StartSeq1 = get_value(since_seq, Options, StartSeq0),
-    StartSeq = {0, StartSeq1},
+    % StartSeq0: can be 0 or a checkpoint.
+    % StartSeq1: If the `since_seq` field is defined, it's equal to the
+    %            value of that field; otherwise, it's equal to StartSeq0.
+    StartSeq2 =
+        case StartSeq0 =:= 0 of

Review Comment:
   We might be able to get away with one less StartSeq var if we do
   
   ```erlang
   StartSeq1 = case StartSeq0 of
       0 -> StartSeq0; 
       _ -> get_value(since_seq, Options, StartSeq0)
   end
   ```
   
   What do you think?



-- 
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: [email protected]

For queries about this service, please contact Infrastructure at:
[email protected]

Reply via email to