couchbase-lite-core icon indicating copy to clipboard operation
couchbase-lite-core copied to clipboard

[Replication] Return client based error for custom validator rejection

Open iwasrobbed-ks opened this issue 5 years ago • 2 comments

Expected Behavior

Within the context of a pull filter during replication, Couchbase should return a client-based error code (e.g. CBLErrorRejectedByClientValidation) when the client chooses to reject pulling a document.

Actual Behavior

Couchbase returns a CBLErrorHTTPForbidden error which doesn't make sense for this scenario (the docs state // User doesn't have permission to access resource but that's not true)

The error shows rejected by validation function but doesn't specify if that's at the sync gateway or client.

Mixing error codes like this makes us think it's an issue at the sync gateway level rather than something the client has control over.

Code

See https://github.com/couchbase/couchbase-lite-core/blob/master/Replicator/IncomingRev.cc#L194

iwasrobbed-ks avatar May 06 '20 01:05 iwasrobbed-ks

Assigning to @snej since this is a behavioral thing

borrrden avatar May 06 '20 21:05 borrrden

Created CBL-1285 to track this

borrrden avatar Sep 17 '20 12:09 borrrden