This PR fixes https://github.com/calvinmetcalf/crypto-pouch/issues/44 by restoring ignored fields to the decrypted document upon read. Previously these fields were attached to the encrypted document but otherwise discarded, as the system assumed the decrypted document would already possess them. This broke replication for documents that were assigned a first revision value during write, as that revision value would only be assigned to the encrypted version. This PR assigns ignored fields like _rev from the encrypted document to its decrypted version so that such documents always have a revision value.
This PR fixes https://github.com/calvinmetcalf/crypto-pouch/issues/44 by restoring ignored fields to the decrypted document upon read. Previously these fields were attached to the encrypted document but otherwise discarded, as the system assumed the decrypted document would already possess them. This broke replication for documents that were assigned a first revision value during write, as that revision value would only be assigned to the encrypted version. This PR assigns ignored fields like
_rev
from the encrypted document to its decrypted version so that such documents always have a revision value.