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/09/17 19:24:33 UTC
[GitHub] [couchdb] jaydoane commented on a diff in pull request #4179: Don't double-encode changes sequence strings in the replicator
jaydoane commented on code in PR #4179:
URL: https://github.com/apache/couchdb/pull/4179#discussion_r973613774
##########
src/couch_replicator/src/couch_replicator_api_wrap.erl:
##########
@@ -539,6 +540,7 @@ changes_since(
Options
) ->
Timeout = erlang:max(1000, InactiveTimeout div 3),
+ Seq = couch_replicator_utils:seq_encode(StartSeq),
Review Comment:
Could also use `Encoded` prefix here for clarification?
##########
src/couch_replicator/src/couch_replicator_scheduler_job.erl:
##########
@@ -1034,6 +1034,9 @@ get_pending_count_int(#rep_state{source = Db} = St) ->
{ok, Pending} = couch_replicator_api_wrap:get_pending_count(Db, Seq),
Pending.
+seq_format(Seq) ->
Review Comment:
I'm slightly uneasy about calling it `seq_format` here when it's actually encoded. Why not `seq_encode`?
##########
src/couch_replicator/src/couch_replicator_api_wrap.erl:
##########
@@ -148,7 +148,8 @@ get_pending_count(#httpdb{} = Db, Seq) when is_number(Seq) ->
end
end);
get_pending_count(#httpdb{} = Db, Seq) ->
- Options = [{path, "_changes"}, {qs, [{"since", ?JSON_ENCODE(Seq)}, {"limit", "0"}]}],
+ Seq1 = couch_replicator_utils:seq_encode(Seq),
Review Comment:
Perhaps prefer `EncodedSeq` to clarify how it's different than `Seq`?
--
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