fix: conditional /_config call to not mess with SyncGatewayUserClient#383
fix: conditional /_config call to not mess with SyncGatewayUserClient#383vipbhardwaj wants to merge 3 commits into
Conversation
| return self.__config | ||
|
|
||
|
|
||
| class DocumentRevision: |
There was a problem hiding this comment.
I don't know if this code belongs in this PR and I'd be curious to see how it is used because > is not necessarily a meaningful operation.
This isn't a DocumentRevision so much as a RevisionID. I can see why you would want to compare them, but I don't think that a greater than comparison is valid generally.
Additionally, these are very much not specific to Sync Gateway and they are used by all of mobile. I do not believe couchbase lite generally will expose these through a public API, but it is definitely possible edge server or couchbase lite js do.
There was a problem hiding this comment.
I see, although I was working on both the things at the same time, different halves of the day. Therefore they both got pushed and yes this is not a part of the issue at hand right now.
The reason I added it is because I had to import the Version class and then fetch SGW version and compare them in every test to validate both version vectors and rev_ids based on the SGW version being test. Its needed to maintain backwards compatibility since the tests have to be in the middle of 3.x & 4.x for many months atleast for now.
There was a problem hiding this comment.
I am keeping it for now since most of the tests do rely on either changing once or a load of concurrent updates on CBL or SGW sides, then verifying _changes and the rev to be higher, amongst other param checks.
I had to manually write repetitive code hence I made this class to de-clutter tests overall.
There was a problem hiding this comment.
Can this be split out from the rosmar conditional PR? It's really helpful for reviewing to only have a PR do one thing and be small.
I think it's good to have a standard function to compare versions, I just want to not have a is_newer_than function.
There was a problem hiding this comment.
That makes sense, I've been getting closer the habit of "smallest-PRs" , but there's some way to go for me.
Anyways, so I make your PR as the parent of this one. But do I also remove my code changes since they're in yours too?
…al clock comparison
|
Hey, @torcolvin since the JIRA to this is also now shifted to resolved thanks to your PR, is it better if we just drop this PR now? |
CBG-5281
the rosmar call to _config was added in the past, but it was at the
_SyncGatewayBaseclass level causing even theSyncGatewayUserClientto end up calling it which led tests to fail since the PUBLIC PORT cannot call that endpoint but the port assigned to User Client subclass uses public port itself.I have added a condition so that if the port is admin then only shall the call go to config check for rosmar bool value. Since otherwise it would fail rosmar tests too regardless. This is backwards compatible as well since if the port is PUBLIC coming from the
SyncGatewayUserClient, there is no point in calling/_config