-
Notifications
You must be signed in to change notification settings - Fork 126
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
Pusher does not report "Forbidden" errors #756
Comments
Our sprint plan is tomorrow, I will tag this for review since it is a cross platform change. |
Note: final decision is that these errors should cause the document to be skipped |
Will an exception be bubbled up that can be handled by the push replication for these documents? |
@snej Should this action trigger a change to LastError of the replicator (or rather, would there be any issue with it) before skipping? |
Ok, there wasn't that much to do on this. It turns out it was just incomplete (only handled in _bulk_docs). So I put the work into |
When the Sync Gateway's Sync Function rejects a document, such as when a user does not have the appropriate role to modify the document, the recommended practice is to throw a "forbidden" exception to reject the document update.
However, the Pusher class in the CBL library does not treat ""Forbidden" errors received from the server as a failure, nor does it set the last error to something that can be handled by the replication changed event.
couchbase-lite-net/src/Couchbase.Lite.Shared/Replication/Pusher.cs
Line 284 in bd26089
As a consumer of the replication class, it would be very useful to be able to handle these forbidden exceptions being thrown by the Sync Gateway. Otherwise, there is no indication of any kind of failure.
The text was updated successfully, but these errors were encountered: