You are viewing a plain text version of this content. The canonical link for it is here.
Posted to notifications@couchdb.apache.org by GitBox <gi...@apache.org> on 2019/09/24 20:37:26 UTC
[GitHub] [couchdb-nano] ColoradoFlyer opened a new issue #181: Passing null
parameters to replication.disable deletes the entire _replicator database
ColoradoFlyer opened a new issue #181: Passing null parameters to replication.disable deletes the entire _replicator database
URL: https://github.com/apache/couchdb-nano/issues/181
When attempting to delete a replication document, if no id an rev is provided, nano deletes the entire _replicator database.
Also, the documentation is wrong -- documentation does not show that document.rev is required -- it is.
For example:
`
// create a replication:
result = await local.db.replication.enable(local_logs, `${replURL}/${local_logs}`, {
continuous: true,
_id: `replicator::logs`
});
// delete the above replication
result = await local.db.replication.disable(result._id, result._rev);
`
This works just fine. Nano will issue a command similar to
`DELETE /_replicator/replicator::logs?rev=1-afd307bf5728aa8e3ed6adf701f09678 HTTP/1.1`
However, if for some reason the replication was **not** able to be created, result will not have an _id or _rev; and the command to delete the replication will cause Nano to issue the command
`DELETE /_replicator HTTP/1.1`
Which will happily destroy the _replicator database, causing any further replication actions to fail with "database does not exist".
Should there be a check on db.replication.disable to ensure that a document _id and _rev are passed in?
----------------------------------------------------------------
This is an automated message from the Apache Git Service.
To respond to the message, please log on to GitHub and use the
URL above to go to the specific comment.
For queries about this service, please contact Infrastructure at:
users@infra.apache.org
With regards,
Apache Git Services