Change the specification of RewrapManyDataKeyResult.bulkWriteResult from BulkWriteResult to Optional<BulkWriteResult>. Update corresponding unified test files to avoid unnecessarily matching bulkWriteResult against an empty document.
Who is the affected end user?
Drivers implementing ClientEncryption.rewrapManyDataKey() and testing against the corresponding unified spec tests.
How does this affect the end user?
The Client Side Encryption spec currently defines the RewrapManyDataKeyResult.bulkWriteResult field as a BulkWriteResult. This is causing some confusion regarding what the value of bulkWriteResult should be provided ClientEncryption.rewrapManyDataKey() does not issue an unnecessary bulk write command due to no matching key documents to rewrap.
How likely is it that this problem or use case will occur?
Users that have already implemented ClientEncryption.rewrapManyDataKey() and RewrapManyDataKeyResult may have to update their implementations to allow for the bulkWriteResult field to be optional.
If the problem does occur, what are the consequences and how severe are they?
If this change is not applied, Drivers may end up with discrepancies in interpretation and implementation of the behavior of rewrapManyDataKey() given the case where there are no matching key documents, thus no well-defined value for bulkWriteResult (an empty document may not be consistent or appropriate across all Drivers).
Is this issue urgent?
Is this ticket required by a downstream team?
Is this ticket only for tests?
No. This may require changes to the implementation of RewrapManyDataKeyResult and corresponding operations that depend on it.