Wrong user exception not thrown in client code

Replication isn’t synchronous. There’s no direct connection between making a change to your local database and what happens on the server. (Consider that the user could be making the local change while offline. Or that your app might replicate to multiple servers.)

The document change you make on the device is purely local, so it succeeds regardless of what the rules on the server are. At some future point (very soon if the device is online and has an active push replication) the change will get sent to the server. The server may then reject it and send back a 403 to the replicator.

We don’t currently have an API for the client to detect individual documents that failed to replicate to the server. Most of the time this happens, it’s a bug in the app’s validation code rather than an issue that needs to be reported to the user — that is, you should be using the same validation logic on the device as on the server.

In your case, you should be preflighting the change in the local database (perhaps by registering a local validation function) to prevent changes from being made that won’t be allowed by the server.

–Jens