Type of sinceSeq can be also a String besides an Integer#527
Type of sinceSeq can be also a String besides an Integer#527
sinceSeq can be also a String besides an Integer#527Conversation
sinceseq from Integer to Stringsinceseq from Integer to JsonElement
ricellis
left a comment
There was a problem hiding this comment.
Nearly there, as discussed offline I think the seq things should preferably be in their own tests.
Otherwise 2 other things:
- don't change the existing API in the ReplicatorDocument model class
- changes entry
| } | ||
|
|
||
| public Integer getSinceSeq() { | ||
| public JsonElement getSinceSeq() { |
There was a problem hiding this comment.
To avoid breaking compatibility with anyone using this still with e.g. Couch 1.x we should not change this API.
I suggest reverting this and adding:
String getSinceSeqString() - which can output the JsonElement string (for both string and number seq types), the existing int method can be modified to check if the JsonElement is a number primitive and return the int if it is and throw (I guess an IllegalStateException) if it isn't.
sinceseq from Integer to JsonElementsinceSeq can be also a String besides an Integer
Thanks for the thorough review! I fixed the nits in f3018dd. |
emlaver
left a comment
There was a problem hiding this comment.
Looks good! We should consider adding a negative test to assert that an error message is thrown when passing in an unexpected type.
An unexpected sinceSeq (e.g. a Meanwhile, the replication document will disappear from the Other types cannot be added, because compilation would fail. |
Checklist
CHANGES.md|CHANGELOG.md) or test/build only changesDescription
Fixes #526
Approach
seqscould beIntegers in CouchDB 1.x andStrings in 2.x, so I changed all the places where they remainedIntegers toJsonElement. With this, bothIntegerandStringcan be used.Security and Privacy
Testing
.sinceSeq(...)call which is going to use aseqfrom a{source_db}/_changesrequest.Monitoring and Logging